catalina.out 与 Tomcat 6.0 一起滚动 [英] catalina.out rolling with Tomcat 6.0

查看:28
本文介绍了catalina.out 与 Tomcat 6.0 一起滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个默认的 tomcat 安装,没有改变日志配置.日志文件(尤其是 catalina.out)似乎正在(每天)正确滚动.

I have a default tomcat installation with no change to the logging configuration. The log files (in particular catalina.out) appear to be getting rolled (daily) correctly.

然而,除了每日日志之外,还有一个 catalina.out 文件,该文件还在继续增长.这是我需要解决的问题,即每天清除它(如果可能,将其完全删除)

However as well as the daily logs there is also a catalina.out file, which just continues to grow. This is what I need to fix, ie have it cleared daily (or remove it altogether if possible)

有人能解释一下这里发生了什么以及控制日志文件大小的最佳策略吗?

Can someone explain what is going on here and the best best strategy for controlling that log file size?

只是为了澄清输出同时写入 catalina.out 和每日日志

Just to clarify the output is being written to catalina.out and the daily log simultaneously

-rw-r--r--  1 solr solr   90920663 Jul 18 01:16 logs/catalina.2009-07-18.log
-rw-r--r--  1 solr solr     238010 Jul 18 01:16 logs/catalina.out

设置swallowOutput 似乎没有任何区别.

Setting swallowOutput appears to not make any difference.

在 tomcat 下运行的应用程序是 solr,以防万一.

The application being run under tomcat is solr in case that is relevant.

推荐答案

修复了它,原来标准日志配置定义了一个文件记录器和一个控制台记录器.文件记录器转到每日 catalina 日志,控制台记录器写入 catalina.out.

Fixed it, turns out the standard logging configuration defines a file logger and also a console logger. The file logger goes to the daily catalina log, and the console logger writes to catalina.out.

修复是在 conf/logging.properties 中更改:

Fix was to change in conf/logging.properties:

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler

这会阻止任何内容写入 catalina.out

That stops anything getting written to catalina.out

这篇关于catalina.out 与 Tomcat 6.0 一起滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆