large log directory of tomcat

The size of the tomcat log file directory get bigger and bigger and has no several gigs. Is there a integrated log file rotation? I cannot find parameters in the configuration.

Hi @spider,

we use Tomcat’s logging for the server.
There are two places where you can change the number of days we keep log files:
<apache-tomcat>/conf/logging.properties and <apache-tomcat>/conf/server.xml.

In the first you will see a maxDays entry for each log file, which defaults to 90 days. In the second, you can add the same parameter to the AccessLogValve (at the end of the file). The Valve could then look something like this:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" maxDays="60" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log" suffix=".txt"/>

(see also our documentation and Tomcat documentation.)

Kind regards
Marvin

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.