tomcat 日志轮换,当前文件具有固定名称,存档基于日期名称
我正在尝试为 tomcat 日志(包括)实现日志轮换。 stdout/ stderr 其中当前文件将具有诸如 stdout.log 或 stderr.log 之类的常量名称,并且每天都会将以前的日志重命名为 stdout.<.log 等...
我尝试使用 log4j dailyfileappender 但这似乎并不来做到这一点。是否可以使用 log4j 来实现此目的,或者我是否必须结合使用诸如rotatelog/cronolog之类的东西来实现此目的?
我的问题与这里的问题类似 - 您能让 Tomcat 6 stdout.log 文件表现得像 log4j DailyRollingFileAppender 吗?。但是,我无法获得 log4j 日志记录来给出必要的结果
I am trying to implement log rotation for tomcat logs incl. stdout/ stderr where the current file will have constant names like stdout.log or stderr.log and on a daily basis it renames the previous log to stdout.<.log etc...
I tried using log4j dailyfileappender but that does not seem to do this. Is it possible to achieve this with log4j or do I have to use something like rotatelog/ cronolog in conjunction with it to achieve this?
My question is similar to the one here - Can you make the Tomcat 6 stdout.log file behave like a log4j DailyRollingFileAppender?. However, I have not been able to get log4j logging to give the necessary results
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 stdout/stderr,您必须使用 cronolog。我已经将它与 tomcat 一起使用了,它的效果非常好。
For stdout/stderr you will have to use cronolog. I have used it with tomcat and it works like a charm.