If you extract the actual slf4j-api jar you'll notice that org.slf4j.impl.StaticLoggerBinder
is not actually included in the jar. SFL4J api is compiled against the class at build but it isn't actually included in the artifact. If you look at the source for org.slf4j.impl.StaticLoggerBinder
in the api module it has no implementation, all the public instance methods throw UnsupportedOperationException
. This is ok, again because that class is excluded from the slf4j-api jar.
The classloader behaves normally and select the first version of org.slf4j.impl.StaticLoggerBinder
that is found when the class needs to be loaded. This will generally be from the first slf4j implementation jar that it listed on the classpath.
Note:
The findPossibleStaticLoggerBinderPathSet()
is only used to warn that there are multiple bindings present on the classpath. It does not actually load any bindings.