ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <epr...@ptc.com>
Subject Re: AW: configuring Log4J from build.xml
Date Fri, 28 Mar 2003 15:51:48 GMT


Nick Pellow wrote:
> Hi Erik, 
> I have run into your problem before! I solved it with a 
> small sortie of ant tasks, not very elegant.

[...]

>    <sysproperty key="log4j.configuration"
>                 value="file:/${log4j.config}"/>

[...]


Nick!  You're a genius!  Thanks a lot -- it turns out that (in my case) 
the sortie of Ant tasks wasn't necessary.  The default initialization of 
Log4J takes the value of the "log4j.configuration" property and attempts 
to convert it into a URL.  I was making the assumption that the Windows 
file path would automatically turn into a valid URL.  All I had to do 
was prepend my <sysproperty> value with the "file" protocol, like so:

       <sysproperty key="log4j.configuration"
                    value="file://${test.log4j.props}"/>

And the default Log4J initialization worked perfectly!

So I guess that in Windows, unlike Unix, a file path does not 
automatically convert to a URL, or at least not in the Log4J code. 
Perhaps this will work in your case too -- if you're still building that 
particular project, I'd try just adding "file://" to the front of the 
<sysproperty> value and see if that works without converting the path 
using <pathconvert>.

Thanks again Nick.


Erik



Mime
View raw message