[logback-user] Tomcat and webapp logging to same file with rollingFileAppender

Roy McMorran mcmorran at mdibl.org
Tue Jun 14 23:23:00 CEST 2011


We're currently using Logback for Tomcat logging via the method 
described at :

There are two separate logback.xml files, one for Tomcat logging at 
$CATALINA_HOME/conf and another in the application WEB-INF/classes 
directory. Both use rollingFileAppender with TimeBasedRollingPolicy to 
roll over nightly. Both appenders write to the same file - 
$CATALINA_HOME/logs/tomcat.log . The contents of the logback.xml files 
can be viewed at

This seems to work well until it is time for the log to roll over. After 
midnight the tomcat.log file is renamed to tomcat.yyyy-MM-dd.log as 
expected. Tomcat begins logging to a new tomcat.log file, as expected. 
However, the application is now logging to the tomcat.yyyy-MM-dd.log , 
which is not what we want. The lsof command tells me that the Tomcat 
process (jsvc) still has both files open.

Can anyone suggest where we may have went wrong in the configuration?


PS: Tomcat 6.0.29, logback 0.9.26


Roy McMorran
Systems Administrator
MDI Biological Laboratory
mcmorran at mdibl.org

More information about the Logback-user mailing list