Skip to content
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

Logback INFO messages are always reported #33626

Closed
bjorntj opened this issue Dec 23, 2022 · 10 comments
Closed

Logback INFO messages are always reported #33626

bjorntj opened this issue Dec 23, 2022 · 10 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@bjorntj
Copy link

bjorntj commented Dec 23, 2022

After upgrading to Spring Boot 3.0.1, I get the following "error" when running my application:

07:56:13,126 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.4.5
07:56:13,135 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
07:56:13,135 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml]
07:56:13,135 |-INFO in ch.qos.logback.classic.BasicConfigurator@2783717b - Setting up default configuration.
......

Downgrading to Spring Boot 3.0.0 removes this.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 23, 2022
@philwebb
Copy link
Member

This is likely caused by #33610 but those messages should only happen if there's a warning. Do you have a sample application we can run that replicates the problem?

@pandrez
Copy link

pandrez commented Jan 2, 2023

Hi @philwebb
I'm also having the same issue. Like requested, I created a really simple app that replicates the problem.

Running the sample app with any profile generates those log messages on startup.

@bjorntj
Copy link
Author

bjorntj commented Jan 2, 2023

Was thinking about this and that I had not created a test project yet but I guess I do not have to now.. :)

@wilkinsona wilkinsona added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 3, 2023
@wilkinsona wilkinsona added this to the 3.0.x milestone Jan 3, 2023
@philwebb philwebb changed the title Could NOT find resource [logback.xml] Logback INFO messages are always reported Jan 5, 2023
@philwebb
Copy link
Member

philwebb commented Jan 5, 2023

Thanks for the sample @pandrez. It looks like in your case the messages are being logged because there is still a warning. If I run the app I see:

12:11:18,540 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@7f485fda - Propagating WARN level on Logger[org.springframework.boot.actuate.endpoint.jmx] onto the JUL framework
12:11:18,540 |-WARN in ch.qos.logback.core.model.processor.AppenderModelHandler - Appender named [CONSOLE] not referenced. Skipping further processing.
12:11:18,540 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [CONSOLE_JSON]

That warning is coming from AppenderModelHandler and happens because there's a CONSOLE appender that isn't referenced.

If I change your config to the following:

    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

    <springProfile name="local">
	    <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
	</springProfile>

    <appender name="CONSOLE_JSON" class="ch.qos.logback.core.ConsoleAppender">
    ...

I don't get the warning.

@philwebb
Copy link
Member

philwebb commented Jan 5, 2023

@bjorntj Does your application have a similar configuration? Are you seeing any |-WARN in messages or do you only get |-INFO messages?

@philwebb philwebb self-assigned this Jan 5, 2023
@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Jan 5, 2023
@pandrez
Copy link

pandrez commented Jan 6, 2023

@philwebb Thank you for your help!
With your feedback, I understood what the problem is. Defining an appender outside the <springProfile> tag when that appender is only used for that given profile generates a warning when a different profile is used.

I solved the problem by defining the profile-specific appenders inside the <springProfile> tag.

Once again, thank you for your support.

@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 Jan 6, 2023
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged and removed type: regression A regression from a previous release status: feedback-provided Feedback has been provided status: invalid An issue that we don't feel is valid labels Jan 6, 2023
@wilkinsona wilkinsona removed this from the 3.0.x milestone Jan 6, 2023
@bjorntj
Copy link
Author

bjorntj commented Jan 6, 2023

Yes, you are correct.. I had several appenders that wasn't referenced.
I guess this is something that changed from 3.0.0 to 3.0.1?

@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 Jan 6, 2023
@wilkinsona
Copy link
Member

Thanks for letting us know. The improved reporting of problems with the configuration is due to the changes made for #33610.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 9, 2023
@naivetoby

This comment was marked as outdated.

@philwebb

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

6 participants