qos-ch/slf4j

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

metametadata opened this issue · 8 comments

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 commented

@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.

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 commented

@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.

Also started to appear after upgrade jenkinsci/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

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 commented

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

Thank you!

@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.