----- Original Message -----

> From: "USHAKOV, Sergey" <s.usha...@chemitech.ru>
> To: users@tomcat.apache.org
> Cc: 
> Sent: Sunday, July 3, 2011 12:51 PM
> Subject: Placing a webapp log file aside by other server log files
> 
> Hi all,
> 
> I am looking for a robust way to get a webapp-specific log file be placed in 
> the 
> same directory where all the other server logs go.
> 
> Using a line like "org.apache.juli.FileHandler.directory = 
> ${catalina.base}/logs" in the webapp's "logging.properties" 
> does not do the job, as server logs location may be changed from 
> ${catalina.base}/logs to something else by the server's 
> "logging.properties".
> 
> Any ideas?
> 
> Thanks and best regards,
> Sergey 


This is probably not the best way, since it will require you to configure 
information in two places (and keep it in sync). However, it should work.

In $CATALINA_BASE/bin/setenv.sh add something like the following to your 
JAVA_OPTS:

JAVA_OPTS="-Dwebapp.logs=some-directory"
EXPORT JAVA_OPTS

In your web application's logging.properties reference ${webapp.logs}/some-file.

This seems to work reasonably well for me using log4j and commons-logging.

. . . . just my two cents.

/mde/


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

Reply via email to