非旋转 log4j 文件附加器?
我们使用 Java 6 和最新版本的 log4j。我们有一个轮换日志的系统进程,所以我们不需要使用我们当前拥有的......
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=/opt/tomcat-instance/nnadbmon/logs/log4j.log
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
我们可以使用什么附加程序,它不会轮换日志,但可以继续利用我们包含的日期模式和文件?谢谢,-戴夫
We're using Java 6 and the latest version of log4j. We have a system process that rotates logs and so we don't need to use what we currently have ...
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=/opt/tomcat-instance/nnadbmon/logs/log4j.log
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
What is an appender we can use that will not rotate logs but can continue to utilize the date pattern and file we have included? Thanks, - Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些是常见的:
Common Appenders
当它们达到一定大小时。
底层文件以用户选择的频率滚动。
使用用户指定的布局。默认目标是
系统.out.
从这里引用 链接
我建议使用 RollingFileAppender 并让您的系统日志滚轮每天执行旋转。
如果您还想要文件上的日期,您可能需要编写自己的 FileAppender。
These are the common ones:
Common Appenders
when they reach a certain size.
underlying file is rolled over at a user chosen frequency.
using a layout specified by the user. The default target is
System.out.
Referenced from here link
I would recommend using the RollingFileAppender and have your system log roller do the daily rotation.
If you want the date on the file as well you may need to write your own FileAppender.