如何从Tomcat日志中删除日期模式 [英] How to remove the date pattern from tomcat logs

查看:80
本文介绍了如何从Tomcat日志中删除日期模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Tomcat将日期附加到日志文件中,例如localhost.2010-12-22.log,并与catalina日志相同.我不希望该日期出现在日志文件中,而且似乎找不到如何删除它的日期.日志记录文档未提及日期模式.任何想法都将不胜感激.

By default Tomcat appends the date to log files e.g., localhost.2010-12-22.log and same with the catalina log. I don't want the date in the log file and I can't seem to find how to remove it. The logging documentation doesn't say anything about the date pattern. Any ideas are greatly appreciated.

http://tomcat.apache.org/tomcat-6.0-doc/logging.html

推荐答案

尽管托马斯(Thomas's)最接近其他答案,但对我没有多大帮助.我找到的文档是:

None of the other answers helped me much, though Thomas's was closest. The documentation I found was:

  • http://tomcat.apache.org/tomcat-6.0-doc/logging.html
  • http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html

因此,我将以下内容添加到Tomcat的logging.properties文件中.这会从localhost日志中删除日期,并从Tomcat默认删除其他三种日志类型的日期:

So I added the following to Tomcat's logging.properties file. This removes the date from the localhost logs, and the other three log types that Tomcat dates by default:

    1catalina.org.apache.juli.FileHandler.rotatable = false
   2localhost.org.apache.juli.FileHandler.rotatable = false
     3manager.org.apache.juli.FileHandler.rotatable = false
4host-manager.org.apache.juli.FileHandler.rotatable = false
   #
   # default is true, which causes a date to be added to the filename

    1catalina.org.apache.juli.FileHandler.suffix = log
   2localhost.org.apache.juli.FileHandler.suffix = log
     3manager.org.apache.juli.FileHandler.suffix = log
4host-manager.org.apache.juli.FileHandler.suffix = log
   #
   # default is .log, but without date, the extra dot is not needed

这篇关于如何从Tomcat日志中删除日期模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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