views:

552

answers:

1

We run our web app in an Apache Tomcat 6 container. Our code uses SLF4J and Logback and rolls/purges just fine. The Tomcat log (catalina, stdout, etc.) just get deleted on a Tomcat service restart.

The problem is we also are doing some HTTP logging. As far as anyone can tell it's coming from this line in the Tomcat server.xml file.

<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve" directory="httplogs" pattern="combined" resolveHosts="false" prefix="" suffix=".log" rotatable="true" fileDateFormat="yyyy-MM-dd" />

This seems to rotate just fine, but never purges. Is there a way to have Tomcat purge this automatically or do I have to modify the restart script to clean the httplogs directory?

+1  A: 

Have you considered using logback-access which integrates with Tomcat? Logback-access replaces Tomcat's own "acccess valve" with an equivalent but much richer alternative. In short, logback-access offers all the power of logback-classic but for HTTP (access) logging,

Ceki