fei*_*fei 3 logging log4j rotation
我试图通过使用DailyRollingFileAppender每天旋转日志文件,但我有一个问题:日志文件不是每天更新,所以当它没有新东西时它不会旋转.
在log4j.properties中是否有一种方法可以设置它以便log4j每天旋转日志文件,即使文件没有变化?
DailyRollingFileAppender如果没有发生日志记录,Log4j 将不会输出空文件.从实施:
/**
* This method differentiates DailyRollingFileAppender from its
* super class.
*
* <p>Before actually logging, this method will check whether it is
* time to do a rollover. If it is, it will schedule the next
* rollover time and then rollover.
* */
protected void subAppend(LoggingEvent event) {
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2351 次 |
| 最近记录: |