java setmaxfilesize,java - 使用SizeAndTimeBasedRollingPolicy时出现MaxFileSize问题 - 堆栈内存溢出...

我用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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值