Tomcat catalina.out grows until server crashes

时间:2016-04-04 18:03:30

标签: tomcat logging tomcat7

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??

2 个答案:

答案 0 :(得分:0)

这就是我想出来的。

  • 启动tomcat
  • 删除catalina.out文件

现在它将不再写入文件。这似乎有效。简单,但一个黑客。有人有更好的解决方案吗?

答案 1 :(得分:-1)

查看在webapps文件夹中部署的所有应用程序的内容。 一个女巫正在您的catalina中编写。out在web-inf / lib / classes中可能包含一个logging.properties文件。

该文件中是否有任何配置为写入ConsoleHandler的处理程序。

尝试一下。

在这一点上,请查看主题Considerations for production usage