2

We have a problem with logging in our application. Unfortunatelly we have multiple SLF4J bindings: one is logback (from Play) that we want to use, but in one of our libraries (jar) there is another StaticLoggerBinder.class, which is chosen on a testing machine (locally all works for me...) and as result we have no logs. Since we cannot remove the problematic jar from dependencies, is there a way to force the SLF4J to use logback?

In a run script when we specify a location of libs I have noticed, that the order of libs is important. Sorting the dependencies alphabetically instead of pointing to lib/* solves the problem, but the solution is rather unstable... I have tried out that solution, but my implenetation ended to be the last on the list (from warning printed at startup by SLF4J).

Can somebody help?

Community
  • 1
  • 1
Kamil R
  • 447
  • 5
  • 11
  • Did u find a solution to this – nagSumanth Dec 01 '15 at 12:43
  • As suggested in the question, I sorted the libs directory, to have the desired jar earlier on the jar "list". I'm not proud of that solution, but it worked. – Kamil R Dec 15 '15 at 10:28
  • How is your application built, and how is the problematic library (the one with the unwanted binding) being pulled in? If you are using maven, then you can just exclude the transitive dependency on the binding when you declare the dependency on the library. – palimpsestor Jan 01 '16 at 02:18

0 Answers0