In 2023-12 our project is switching our SLF4J dependencies, from: org.slf4j.api/org.slf4j.binding.simple 1.7.30 from 2023-06 Orbit repo to: slf4j.api/slf4j.simple 2.0.9 from 2023-12 Orbit aggregation repo
After the switch, the slf4j.simple binding no longer seems to be found by the LoggerFactory. SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. Debugging, it seems that the logger factory is trying to find the bindings with ServiceLoader.load(SLF4JServiceProvider.class, classLoaderOfLoggerFactory), where the class loader is an EquinoxClassLoader[slf4j.api]. This should find SimpleServiceProvider from slf4j.simple bundle, but it does not. With test code I can also see that the slf4j.api Equinox class loader is not able to find the SimpleServiceProvider class. What I noticed is that, in SLF4J 1.7.30, the org.slf4j.binding.simple is actually a fragment plugin with org.slf4j.api as the fragment-host. But in SLF4J 2.0.9, slf4j.simple is no longer a fragment of slf4j.api. This might explain why its class loader can no longer find the service from another plugin? It so happens that in our project we have a fragment plugin of org.slf4j.api whose only purpose is to provide the simplelogger.properties resource, as this file must also be found by the org.slf4j.api class loader at initialization. So I tried adding the slf4j.simple as a dependency of our fragment plugin. This makes it now possible for the slf4j.api class loader to load the SimpleServiceProvider class in my test code. But the LoggerFactory still isn't able to find it using the ServiceLoader. Maybe ServiceLoader doesn't work with plugin fragments? Does anyone have any idea how this is supposed to work? I don't know what I'm doing wrong. But then again, I know nothing, Jon Snow. I read this: https://www.slf4j.org/faq.html#changesInVersion200, it just says both plugins must be in the classpath. I do see them in the Classpath of my test plugin (through Plug-In Dependencies), but slf4j.simple is presumably not in the classpath of the default slf4j.api plugin? And there are no Java Build Path properties for fragment plugins. Thanks for any help, Patrick
_______________________________________________ cross-project-issues-dev mailing list cross-project-issues-dev@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cross-project-issues-dev