tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <antonio.petre...@gmail.com>
Subject Re: Log4j
Date Tue, 22 Sep 2009 11:01:30 GMT
2009/9/22 Nishant Chandra <nishant.chandra@gmail.com>:
> 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 log4j.properties?
> 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 "log4j.properties" file and
modify only the property that refers to the path of the file, then
configure Log4j.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message