Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: AW: configuring Log4J from build.xml

AW: AW: configuring Log4J from build.xml

2003-03-28       - By Nick Pellow
Reply:     1     2  

Erik,

> -----Ursprungliche Nachricht-----
> Von: Erik Price [mailto:eprice@(protected)]

> 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.

> 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!

Cheers Erik! That works a treat for me now on both my windoze and
Unix machines. One must remember however that ${test.log4j.props}
must/be/the/a/fully/qualified/path and not a relative one. I use the
${basedir} to help build this.

Also, something that really helped with this problem:
Turn the log4j debugging mode on:
  <sysproperty key="log4j.debug"
                  value="true"/>
It is very nice to see exactly what is happening under the hood of log4j
at runtime.

> if you're still building that
> particular project,

Sure am. Gets built after every cvs commit.

Thanks again Erik,
Nick.

>
> Thanks again Nick.
>
>
> Erik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.