Title: RE: Property substitution in DOMConfigurator.

Thanks for getting back to me.  I did see that this functionality was being added in 1.1.  However, I disagree that my patch breaks functionality with windows file names.

In version 1.0.4, when specifying a file path for a file appender in an xml configuration file, you would have to do so by escaping the back-slashes like so:

"c:\\temp\\log4j.log"

The call to convertSpecialChars is what changes this to something usable by the File object, namely "c:\temp\log4j.log".

The functionality was carried over to 1.1bX even after the support for variable substitution was added.  This is fine and good, but the special character conversion was being done after the variable substitution, so if you had a line like this:

"{user.home}\\log4j.log"
After substitution it would look like this:
"c:\winnt\profiles\stevenv\\log4j.log"
And after special character conversion it would look something like this:
"c:winntprofilesstevenv\log4j.log"

I simply reversed the order of substitution and conversion so that that it would be converted first to this:
"{user.home}\log4j.log"
And then to this:
"c:\winnt\profiles\stevenv\log4j.log"

Which is a file that is more likely to be present on the disk.

This is the particular application  for which I made the change, but I believe this is a better way to do it in general because I would think that by the time a value has been stored in a system property it would have already had special character conversion applied to it.

I know this is a small issue, but this is a feature I would particularly like to be able to use on my platform. 

Thank you,
Steven.

-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 05, 2001 7:06 PM
To: LOG4J Developers Mailing List
Subject: Re: Property substitution in DOMConfigurator.



Steven,

Property substitution in DOMConfigurator is supported. This support should be enhanced to include taking properties from a Properties object or a file instead of just System.properties as done currently. Ceki


At 14:28 05.04.2001 -0400, you wrote:

>Is there a reason why this is not supported as it is in the PropertyConfigurator?  I browsed through the source and determined that it would be pretty easy to add, but I was wondering if it was purposefully left out.

>
>If my terminology is incorrect or if I am being unclear, I want to do this:
>
><appender name="A1" class="org.apache.log4j.FileAppender">
>    <!-- notice this line -->
>    <param name="File"   value="${user.home}\\A1.log" />
>    <param name="Append" value="false" />              
>    <layout class="org.apache.log4j.PatternLayout">
>        <param name="ConversionPattern" value="%t %-5p %c{2} - %m\n"/>
>    </layout>      
></appender>
>
>If I were to patch the existing code to support this, would I be wreaking havoc somewhere or parting from someone else's philosophy?

>
>Thanks for any help.
>
>Steven Velez
>Software Engineer
>alventive
>678-202-2226

--
Ceki Gülcü


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to