ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dylan Farre <>
Subject Using Log4J with Ant on Unix
Date Tue, 10 Mar 2009 15:55:31 GMT
Hi, I am having a problem, using Log4J with Ant on Unix.

My project runs fine on Win and Unix. On Win, Log4J logs all the debug info
to a log file for me. On Unix, it does not. It does not give any errors or
anything. I have checked the obvious things like, does the file exist and
does the user have permissions to edit it.

I am able to echo directly to the file from within my Ant project and this
works fine. On Win my echos and the Log4J info gets into the file, but on
Unix, only my echos get into the file.

This is how I invoke Ant in a ksh script:
#!/usr/bin/ksh BASEDIR=$PWD export BASEDIR ANT_HOME=$BASEDIR/Ant_1.7.0
export ANT_HOME PATH=$PATH:$ANT_HOME/bin export PATH
JAVACMD=/usr/jdk/instances/jdk1.5.0/jre/bin/java export JAVACMD #
The CLASSPATH below was neccessary on Win to get Log4J to work.
cd / chmod -R 777 $BASEDIR cd $BASEDIR $ANT_HOME/bin/ant -f
$BASEDIR/build.xml -q -e -listener

I tried this where the ## is, but it made no difference:
rm Full_Ant_Log.log touch Full_Ant_Log.log chmod -R 777

My config Log4J properties file,, is in the
CLASSPATH=$ANT_HOME/lib/ directory

And it looks like this:

# Configuration Appender "FILE"
log4j.appender.FILE.layout.ConversionPattern=%-5p: %d: %m%n
log4j.appender.FILE.threshold=DEBUG # Use Appender "FILE"
log4j.rootLogger=DEBUG, FILE

I tried,
instead of

But that did not make a difference.

I am using Ant 1.7.0 and log4j 1.2.15.

I am using the same downloaded file of Ant 1.7.0 and log4j 1.2.15 for
Windows and Unix, is this ok?

Any help will be much appreciated.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message