logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <...@urbanet.ch>
Subject Re: Location of log files
Date Fri, 05 Jan 2001 15:22:23 GMT
At 14:38 05.01.2001 +0000, you wrote:
>Just spent the morning implementing log4j, a lovely thing.  Why didn't I
>start using it 6 months ago?
>
>Just one question:
>
>Is there any way I can set in code a root directory for log files, so that
>the log4j.properties becomes more portable?
>
>i.e.: instead of
>
>log4j.appender.statsLog.File=/home/appserver/tomcat/logs/stats.log
>
>i should be able to use
>
>log4j.appender.statsLog.File=stats.log
>
>then use code when I use the PropertyConfigurator to set the root directory?
>
>Thanks,
>
>Alistair.

In log4j version 1.0, it will be possible to say:

mydir=/home/appserver/tomcat/logs
log4j.appender.statsLog.File=${mydir}/stats.log
log4j.appender.xyzLog.File=${mydir}/xyz.log

Moreover, you will be able to set the mydir variable either in the config 
file or as a system property. Regards, Ceki


Mime
View raw message