logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgarrison <jgarri...@troux.com>
Subject log4j.properties and substition of user properties
Date Wed, 19 Aug 2009 21:22:05 GMT

I have the following in a log4j.properties

...
log4j.appender.LogFile=org.apache.log4j.FileAppender
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n
log4j.appender.LogFile.file=${work.dir}/build.log
log4j.appender.LogFile.append=false
...

This is being used by an invocation of ANT in which the command line
contains 

    ....  -Dwork.dir=/a/valid/directory .....

The ANT property ${work.dir} is successfully referenced in the ANT
buildfiles, but log4j resolves it to the null string, attempting to put the
build.log file in the root, which obviously doesn't work.  I know ANT is
using the log4j.properties because when I put in an absolute path for
LogFile.file it works correctly.

Based on my reading of the docs, I expected this to work, and the fact that
${work.dir} gets replaced with a null string tells me that log4j is
attempting to resolve it, but just doesn't have a value for it.  What do I
need to do to get the value to log4j?

If this question is more appropriate for an ANT forum I apologize in
advance.
-- 
View this message in context: http://www.nabble.com/log4j.properties-and-substition-of-user-properties-tp25052177p25052177.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message