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 Henrik Vendelbo <hv...@bluprints.com> on 2003/10/10 02:03:05 UTC

controlling log directory

How do you configure log directory. I would prefer setting it independent of
the file name.
Can I define it in log4j.properties, or by modifying properties runtime ?

I currently use absolute paths just with forward / under NT, but apparently
it isnt working.



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


Re: controlling log directory

Posted by Paul Smith <pa...@lawlex.com.au>.
On Fri, 2003-10-10 at 10:03, Henrik Vendelbo wrote:
> How do you configure log directory. I would prefer setting it independent of
> the file name.
> Can I define it in log4j.properties, or by modifying properties runtime ?
> 
> I currently use absolute paths just with forward / under NT, but apparently
> it isnt working.

Hi Henrik,

We have this line at the top of our log4j.properties file:

webappRoot=/var/tomcat4/webapps/

then in our appender config:

log4j.appender.taipanAppender.file=${webappRoot}Taipan/logs/taipan-log4j.log

This allows a little more flexibility in defining a base directory etc. 
For windows, you will probably need something like:

webappRoot=c:\\toolkit\\tomcat4.0\\webapps\\

Mainly because of \ need to be escaped.

Hope this helps you.

regards,

Paul Smith


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