ljacomet / logging-capabilities

Apache License 2.0
40 stars 6 forks source link

Handle slf4j-jdk14 in enforceLogback() #23

Closed paskos closed 1 year ago

paskos commented 2 years ago

enforceLogback() does not handle org.slf4j:slf4j-jdk14 dependency.

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.JDK14LoggerFactory loaded from slf4j-jdk14-1.7.36.jar.

ljacomet commented 1 year ago

Thanks for your interest in this plugin

Would you be able to provide a reproducer?

Because from what I can tell, slf4j-jdk14 shares a capability with logback-classic and when enforceLogback() is used, that capability conflict is resolved in favor of logback-classic.

See https://github.com/ljacomet/logging-capabilities/blob/d3899d1818814fe3e9ac21fb8bc537c7afef3267/src/main/java/dev/jacomet/gradle/plugins/logging/extension/LoggingCapabilitiesExtension.java#L56-L57

ljacomet commented 1 year ago

I tried reproducing and failed.

Closing for now.