Search code examples
tomcatloggingtomcat7

Tomcat catalina.out grows until server crashes


I have a Tomcat7 webserver running on CentOS Linux. Tomcat is configured by default to write all System.out to the /logs/catalina.out file. It does not rotate or trim this file, so it will eventually exceed the max file size and crash the web server.

Given this does not seem like a good idea... how to prevent this?

I found, catalina.out rolling with Tomcat 6.0

and I configured my logging.properties like it said, but this does not seem to work, maybe it prevents Tomcat from logging to catalina.out, but still every other System.out write is going to the file.

The odd thing is I have two identical servers, configured in the exact same way, but one is writing to catalina.out, and the other is not??


Solution

  • Well this is what I came up with.

    • start tomcat
    • delete the catalina.out file

    Now it will no longer write to the file. This seems to work. Simple, but a hack. Anyone got a better solutions?