Replace slf4j-simple Dependency w/ slf4j-api
See original GitHub issueIs your feature request related to a problem? Please describe. Redisson in https://github.com/redisson/redisson/blob/master/redisson-all/pom.xml#L96 creates a hard dependency on an SLF4J binding, which if you already have a binding in place in your application, causes logs like:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/tomcat/apache-tomcat-7.0.90/lib/redisson-all-3.13.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/tomcat/apache-tomcat-7.0.90/webapps/some-webapp/WEB-INF/lib/slf4j-nop-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
Note the link and warning from SLF4J: http://www.slf4j.org/codes.html#multiple_bindings. This is a random behavior and could be catastrophic depending on your intended logging config versus what Redisson attempts to do. Also note this paragraph:
Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J’s purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways.
Describe the solution you’d like
Remove the dependency on slf4j-simple
and replace it with slf4j-api
like is recommended by SLF4J. This is noted in the SLF4J link above and is concisely:
Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api.
Describe alternatives you’ve considered
We have considered rebuilding the Redisson jars to remove this dependency, but it should not be there to begin with.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Fixed
Maybe that‘s because redisson is a dependency of some app which could be handled by build tools like maven or gradle in other integration situations, while with tomcat you have to put it manually. In fact, you can place redisson-tomcat-X-*.jar and all jars it depends on(including transitived ones) into tomcat/lib.
But yet, I vote for an extra redisson-tomcat-full.jar without slf4j-simple. :p