Tomcat – How to Turn Off All Log Rotation

loggingtomcat

I want to manage log rotation on my server using logrotate, however Tomcat performs its own log rotation which interacts badly with logrotate, and I can't find a way to turn it off. My Tomcat instance currently produces 5 types of log:

  • catalina.2018-01-17.log
  • mysite_access.2018-01-17.log
  • localhost.2018-01-17.log
  • host-manager.2018-01-17.log
  • manager.2018-01-17.log

After some googling I have discovered that I can disable rotation for the 'mysite' logs by adding rotatable="false" into the appropriate <Value> element in server.xml, but none of the other logs have corresponding <Value> elements.

The logs seems to be configured by the logging.properties file, but I can't find a 'turn rotation off' option for this file. Can anyone help? I'm using Tomcat 8.5

Best Answer

You're probably using JULI logging as the default in your tomcat instance. Try this

1catalina.org.apache.juli.FileHandler.rotatable = false

In logging.properties.

There are some samples online if you search for that property.

If you're not using those logs for anything, you can just remove or rename off the logging.properties file to stop using JULI logging.

Related Topic