tomcat 日志轮换,当前文件具有固定名称,存档基于日期名称

发布于 2025-01-05 23:23:48 字数 502 浏览 3 评论 0原文

我正在尝试为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾北清歌寒 2025-01-12 23:23:48

对于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文