-
Notifications
You must be signed in to change notification settings - Fork 0
Serverconfigs
With the default configuration under Ubuntu 20.04, the following log files are written into /var/log/tomcat9
:
catalina.out
catalina.<date>.log
localhost_access_log.<date>.log
localhost.<date>.log
Tomcat does not cleanup old files, but logrotate does. There is a configuration in /etc/logrotate.d/tomcat9
, but this will only affect catalina.out
by default.
Go to /etc/tomcat9/server.xml
Replace default values:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
By this:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
pattern="combined" rotatable="false"
prefix="access_log" />
In /etc/logrotate.d/tomcat9
:
Add the new filename schema to the first line:
/var/log/tomcat9/catalina.out {
=> /var/log/tomcat9/catalina.out /var/log/tomcat9/access_log {
Note: These settings are still experimental and will be rolled out on the servers as soon as they are tested on our development machines.