我用10KB定义了以下配置,但20KB之后我仍然可以看到新的日志会追加到现有的日志文件中。 我期望如果日志大小增加超过10KB,那么将自动实现旧日志。 下面是我的pom.xml
ch.qos.logback
logback-classic
1.3.0-alpha5
下面是我的logback.xml
class="ch.qos.logback.core.rolling.RollingFileAppender">
${logPath}/zapp-info.log
${logPath}/archived/zapp.%d{yyyy-MM-dd}.%i.log
10KB
20GB
10
%d %-5level %t %c{0} %msg%n
在控制台上的日志下方。
1:00:57,545 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7f560810 - Roll-over at midnight.
11:00:57,557 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7f560810 - Setting initial period to Tue Nov 05 23:32:59 IST 2019
11:00:57,587 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE-ROLLING] - Active log file name: /Users/znrind-a0053/Downloads/logs/zapp-info.log
11:00:57,587 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE-ROLLING] - File property is set to [/Users/znrind-a0053/Downloads/logs/zapp-info.log]
11:00:57,589 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler@1b0375b3 - Attaching appender [FILE-ROLLING] to Logger[ROOT]
11:00:57,603 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@ae45eb6 - End of configuration.
11:00:57,604 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6f7fd0e6 - Registering current configuration as safe fallback point
11:00:57,609 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/Users/znrind-a0053/Downloads/logs/zapp-info.log] to [/Users/znrind-a0053/Downloads/logs/archived/zapp.2019-11-05.0.log]
11:00:57,755 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - first clean up after appender initialization
11:00:57,758 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - Multiple periods, i.e. 32 periods, seem to have elapsed. This is expected at application start.