You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In org.slf4j.LoggerFactory the following row:
serviceLoader = ServiceLoader.load(SLF4JServiceProvider.class, classLoaderOfLoggerFactory);
has a problem, if classLoaderOfLoggerFactory is a org.eclipse.osgi.internal.loader.EquinoxClassLoader.
Then the loaded serviceLoader has an empty loadedProviders Array.
SLF4J 2 assumes that a Service Loader Mediator like Apache SPI Fly is present in your OSGi environment. You need to add the bundle to your Equinox deployment.
Because you get following output in this case:
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
@Holzmacher Thank you for following up on this issue. It is much appreciated.
I should observe that the code in initSLF4JServiceProvider creates a second logging system unrelated to the one used by LoggerFactory. Thus, it is not a general solution.
However, it is not clear if the first part of your answer is sufficient and whether initSLF4JServiceProvider was provided for illustration purposes only and is not actually needed.
In org.slf4j.LoggerFactory the following row:
serviceLoader = ServiceLoader.load(SLF4JServiceProvider.class, classLoaderOfLoggerFactory);
has a problem, if classLoaderOfLoggerFactory is a org.eclipse.osgi.internal.loader.EquinoxClassLoader.
Then the loaded serviceLoader has an empty loadedProviders Array.
Seee also:
https://stackoverflow.com/questions/78783619/logback-logger-1-5-0-with-eclipse-4-31-no-slf4j-providers-were-found/78904640#78904640
The text was updated successfully, but these errors were encountered: