Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class path contains multiple SLF4J bindings. #23

Open
jeanlaurent opened this issue May 2, 2014 · 4 comments
Open

Class path contains multiple SLF4J bindings. #23

jeanlaurent opened this issue May 2, 2014 · 4 comments
Labels

Comments

@jeanlaurent
Copy link
Member

While migrating from fluent-http 1.20 to 1.49 I stumbled upon;

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/jlm/.m2/repository/org/slf4j/slf4j-simple/1.7.7/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jlm/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]

When looking at http://www.slf4j.org/codes.html#multiple_bindings they state that
Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api

This should apply to fluent-http since we embed fluent-http in apps, that's exactly the right usage.
This shouldn't apply to fluent-http since we want a tool usable whitout fiddling with dreaded logging framework.

discuss...

@dgageot
Copy link
Member

dgageot commented May 2, 2014

To make it easy to use fluent-http, I made slf4j-simple not optional. To really use it in production, you should exclude slf4j-simple in Maven.

Didn't find a better solution.

@framiere
Copy link
Contributor

framiere commented May 2, 2014

You could implement your own slf4j facade and use it unless another facade
is in the classpath.
Thus no more slf4j-simple dependency.

On Fri, May 2, 2014 at 5:09 PM, David Gageot [email protected]:

To make it easy to use fluent-http, I made slf4j-simple not optional. To
really use it in production, you should exclude slf4j-simple in Maven.

Didn't find a better solution.


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-42041826
.

Florent Ramière
Mobile: (+33) 6 25 12 40 34
Email: [email protected]

@dgageot
Copy link
Member

dgageot commented May 3, 2014

Our code could use a facade. But we embed some librairies that need slf4j to be present.

@jeanlaurent
Copy link
Member Author

I think this rings back to our core-stuff, app-stuff module cutting.
We could have a core stuff not using slf4j-simple but slf4j-api and the app module using slf4j-simple.

Maybe it's too soon, but we need to keep that in mind whenever we will cut down the app in modules (or not ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants