Spring-boot: LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy

Created on 21 Apr 2020  ·  14Comments  ·  Source: spring-projects/spring-boot

when I try to use spring boot default configuration to configure a rolling log files,logback show tips like title,so I view source(v2.2.6.RELEASE) to find the reason. in 150 lines of DefaultLogbackConfiguration.java,

private void setRollingPolicy(RollingFileAppender<ILoggingEvent> appender, LogbackConfigurator config,
            String logFile) {
        SizeAndTimeBasedRollingPolicy<ILoggingEvent> rollingPolicy = new SizeAndTimeBasedRollingPolicy<>();
        ...
        rollingPolicy.setTotalSizeCap(new FileSize(totalSizeCap.toBytes()));
        appender.setRollingPolicy(rollingPolicy);
        ...
    }

when then rollingPolicy setRollingPolicy,logback show this tips,the tips info in 74 line of ContextAwareBase.java,the problem is not serious but very vexed, please repair it as soon as possible,thanks!

bug

Most helpful comment

I can confirm this problem too.

All 14 comments

Thanks for the report. I haven't seen Logback output LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy when using Boot's default logging configuration. Can you please provide a small sample that reproduces this behaviour so that we can investigate? You can a provide a sample by zipping it up and attaching it to this issue or by pushing it to a separate repository.

Thanks for the report. I haven't seen Logback output LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy when using Boot's default logging configuration. Can you please provide a small sample that reproduces this behaviour so that we can investigate? You can a provide a sample by zipping it up and attaching it to this issue or by pushing it to a separate repository.

demo.zip

Thanks. I've reproduced the problem.

I can confirm this problem too.

I can confirm this problem too.

It just a tips,If you don't want to see this information you can put a logback-spring.xml into classpath.

Does anyone know when this was first introduced?

I can confirm this problem. Change SizeAndTimeBasedRollingPolicy.java to TimeBasedRollingPolicy.java can fix the warning. I found logback自定义logger的java代码 works well, but logback运行时动态创建日志文件 show the problem. My springboot version is 2.0.1.RELEASE. Waiting for the good news.

@Hlingoes interesting, we never had this problem before 2.2.X, running some microservices with 2.1.7 without any issues.

I can confirm this problem too, with spring boot : 2.2.8.RELEASE version

Same problem with SpringBoot v2.2.7.RELEASE :
LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@768185844

Thanks everyone. We’ve already reproduced the problem and just need the time to fix it. In the meantime there’s no need to confirm that it occurs.

Alguna solución con este tema pendiente???

@besserer the issue was fixed in 2.2.9 so please upgrade to that.

Was this page helpful?
0 / 5 - 0 ratings