You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by chris derham <ch...@derham.me.uk> on 2011/08/12 19:14:17 UTC

How do I log to a filename based on the full context name?

Reading
http://www.javacodegeeks.com/2011/06/zero-downtime-deployment-and-rollback.html?m=1,
it states

If you do not use the full context name of the application in the log file
name, you may end up in a situation where both versions of a web application
are writing into the same log file

So how do I get this full context name? We currently use the following to
configure the filename under log4j 1.2.16 under tomcat 7.0.19 on windows
2008 64bit

            <param name="FileNamePattern"
value="${catalina.base}/logs/myapplication.%d{yyyy-MM-dd}.log" />

Thanks

Chris