You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jesse Barnum <js...@360works.com> on 2014/01/09 19:48:46 UTC

Name log files based on Context name?

I want my log files to be written to a log file with the same name as my webapp. Users can dynamically re-name my webapp when they run my installer, so that they can have multiple instances running, so hard-coding the context name is not a good approach. Is there some environment variable that I can use in the log file?

> 1catalina.org.apache.juli.FileHandler.level = FINE
> 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> 1catalina.org.apache.juli.FileHandler.prefix = MirrorSync.
> 1catalina.org.apache.juli.FileHandler.encoding = UTF-8

I'd like the word "MirrorSync" to be replaced with the name of the context where this logging.properties file is loaded from (the logging.properties file is in my classes/ directory). I tried using ${context} but it just put that literal value for the log name.

My users are mostly running in Tomcat 6, with a few who have upgraded to 7.

--Jesse Barnum, President, 360Works
http://www.360works.com
Product updates and news on http://facebook.com/360Works
(770) 234-9293
== Don't lose your data! http://360works.com/safetynet/ for FileMaker Server ==


Re: Name log files based on Context name?

Posted by Mark Thomas <ma...@apache.org>.
On 09/01/2014 18:48, Jesse Barnum wrote:
> I want my log files to be written to a log file with the same name as my webapp. Users can dynamically re-name my webapp when they run my installer, so that they can have multiple instances running, so hard-coding the context name is not a good approach. Is there some environment variable that I can use in the log file?
> 
>> 1catalina.org.apache.juli.FileHandler.level = FINE
>> 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
>> 1catalina.org.apache.juli.FileHandler.prefix = MirrorSync.
>> 1catalina.org.apache.juli.FileHandler.encoding = UTF-8
> 
> I'd like the word "MirrorSync" to be replaced with the name of the context where this logging.properties file is loaded from (the logging.properties file is in my classes/ directory). I tried using ${context} but it just put that literal value for the log name.
> 
> My users are mostly running in Tomcat 6, with a few who have upgraded to 7.

https://issues.apache.org/bugzilla/show_bug.cgi?id=43682

Mark


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