You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Alistair Hopkins <al...@berthengron.co.uk> on 2001/01/05 15:38:17 UTC

Location of log files

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.


RE: Location of log files

Posted by Alistair Hopkins <al...@berthengron.co.uk>.
I'll look forward to it.
Thanks,

Alistair

-----Original Message-----
From: Ceki Gulcu [mailto:cgu@urbanet.ch]
Sent: Friday, January 05, 2001 3:22 PM
To: LOG4J Users Mailing List
Subject: Re: Location of log files


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


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



Re: Location of log files

Posted by Ceki Gulcu <cg...@urbanet.ch>.
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