Play logback doesnt work when explicit logback dependency is on classpath

I need to have explicit dependency on logback during uberbuild to avoid issue at runtime conflicting with log4j. However when I do this play logback play.api.Logger stops working. It’s happening for standalone non-mvc app where play logback is used.

its a dreaded “conflicting slf4j binding found on classpath” issue. off topic, but runtime found both slf4j-log4j12 and logback on classpath. something might have introduced some dependency that brought log4j in picture.

Yes indeed. Lots of libraries depend upon that, and need to be excluded. Some of my dependencies

  "org.apache.hadoop" % "hadoop-common" % "2.7.2" exclude("org.slf4j", "slf4j-log4j12"),
  "org.apache.hadoop" % "hadoop-hdfs" % "2.7.2" exclude("org.slf4j", "slf4j-log4j12"),
  "org.cassandraunit" % "cassandra-unit" % "2.1.3.1" exclude("org.slf4j", "slf4j-log4j12")

Have used GitHub - sbt/sbt-dependency-graph: sbt plugin to create a dependency graph for your project in the past for getting the dependency tree, but surely newer sbt may have some native integration to view dependency tree too.

Regards
Aditya

You can also use https://github.com/cb372/sbt-explicit-dependencies to show the explicit dependencies of each library.