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

Unexpected new log SLF4J(I): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider] #422

Closed
metametadata opened this issue Aug 7, 2024 · 9 comments
Assignees
Labels
DONE for fixed issues
Milestone

Comments

@metametadata
Copy link

After bumping org.slf4j/slf4j-api from 2.0.13 to 2.0.14 I see an unexpected message printed in my projects:

SLF4J(I): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider]


@ceki
Copy link
Member

ceki commented Aug 7, 2024

@metametadata I understand that the message may be considered useless. However, in many cases when logging does not work as expected, the information about the provider in use goes a long way in diagnosing logging issues.

As for the removal of isAmbiguousProviderList check, the check for multiple Provider ambiguity is reported earlier if relevant, but a successful connection with a provider is now reported every time regardless of provider ambiguity.

@metametadata
Copy link
Author

As for the removal of isAmbiguousProviderList check, the check for multiple Provider ambiguity is reported earlier if relevant, but a successful connection with a provider is now reported every time regardless of provider ambiguity.

Right, the point was that the change is unjustified or even looks unintentional as the commit message is migrate to Java 11 🤷 But it's clear now, thanks!

Maybe as an alternative, this info could be printed at some kind of DEBUG level (or something like that)? So that by default users don't see it, but will see this message on bumping into problems and enabling the "debug mode" of slf4j.

@ceki
Copy link
Member

ceki commented Aug 7, 2024

@metametadata The commit you mention is on the 2.1 branch. The message for the commit 4281010 on the 2.0/main branch is much clearer. However, I get your point.

Thank you for your suggestion. I have to let the question mature somewhat more and may end up adopting something similar.

@jonesbusy
Copy link

Also started to appear after upgrade jenkins-infra/plugin-modernizer-tool#168

SLF4J(I): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider]

I don't expect a patch upgrade starting to print this line on a CLI application when it start. It's kind of confusing.

For us System.setProperty("slf4j.internal.verbosity", "WARN") did the trick

@lprimak
Copy link

lprimak commented Aug 9, 2024

What makes this a critical issue is that this message is printed to stderr, which causes alerts from all sorts of monitoring / observability tools.

At the very least, it should go to stdout or, better yet, none at all, i.e. DEBUG level as suggested earleier

@ceki ceki self-assigned this Aug 10, 2024
@ceki ceki added the DONE for fixed issues label Aug 10, 2024
@ceki ceki added this to the 2.0.16 milestone Aug 10, 2024
@ceki
Copy link
Member

ceki commented Aug 10, 2024

Fixed as suggested by @metametadata. See version 2.0.16 release notes.

@ceki ceki closed this as completed Aug 10, 2024
@metametadata
Copy link
Author

Thank you!

@bschuhmann
Copy link

@ceki, in case slf4j.provider is set, there's another log message I'd consider unexpected:

SLF4J(I): Attempting to load provider "org.apache.logging.slf4j.SLF4JServiceProvider" specified via "slf4j.provider" system property

Is there a reason this should stay on INFO level? I'm setting slf4j.provider explicitly, so expect it is used - and only if it isn't I can change the log level to DEBUG and verify slf4j.provider has been picked up or not.

@wohler
Copy link

wohler commented Jan 28, 2025

This message has seemed to rear its ugly head again in 2.1.0-alpha1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONE for fixed issues
Projects
None yet
Development

No branches or pull requests

7 participants
@ceki @bschuhmann @jonesbusy @lprimak @metametadata @wohler and others