Skip to content

LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy #21056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bauline opened this issue Apr 21, 2020 · 17 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@bauline
Copy link

bauline commented Apr 21, 2020

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!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 21, 2020
@wilkinsona
Copy link
Member

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.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Apr 21, 2020
@bauline
Copy link
Author

bauline commented Apr 21, 2020

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

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 21, 2020
@wilkinsona
Copy link
Member

Thanks. I've reproduced the problem.

@wilkinsona wilkinsona added type: bug A general bug and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Apr 21, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Apr 21, 2020
@Drezir
Copy link

Drezir commented Apr 22, 2020

I can confirm this problem too.

@bauline
Copy link
Author

bauline commented Apr 23, 2020

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.

@kamaci
Copy link

kamaci commented May 1, 2020

@Fantaztig
Copy link

Does anyone know when this was first introduced?

@Hlingoes
Copy link

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.

@Fantaztig
Copy link

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

@jaadlani
Copy link

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

@jeanemvista
Copy link

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

@wilkinsona
Copy link
Member

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.

@besserer

This comment has been minimized.

@snicoll

This comment has been minimized.

@greedyaj
Copy link

@snicoll , I am facing this issue with console appender, getting below messages
LOGBACK: No context given for ch.qos.logback.core.spi.ContextAwareBase@4f880e48
LOGBACK: No context given for ch.qos.logback.core.spi.ContextAwareBase@4a7d5552

@wilkinsona
Copy link
Member

@greedyaj That doesn't sounds like the same problem as this issue was specific to SizeAndTimeBasedRollingPolicy. If you believe you've found a bug please open a new issue with a minimal sample that reproduces the problem.

@greedyaj
Copy link

@wilkinsona Created new issue #27729
Please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests