tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <>
Subject Re: Log4j
Date Tue, 22 Sep 2009 11:01:30 GMT
2009/9/22 Nishant Chandra <>:
> I want to use Log4j and log from different web apps to one directory -
> tomcat_home/output/logs/{webapp_context}_service.log
> What should be the configuration in
> I am currently using
> log4j.appender.xml.file=${catalina.base}/output/logs/service.log
> What I want is to append app_context in the file name.

IIRC, there is no way to obtain the application context path as an
environment variable.
You should configure Log4j using its APIs, using a ServletContextListener.
Probably the best way is to load the "" file and
modify only the property that refers to the path of the file, then
configure Log4j.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message