Logback does not work with über-JAR
MattSzm opened this issue · comments
Mateusz Szmal commented
When creating a Jar with the logback dependency and then running this Jar I get this error:
LF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
During a casual run, this works without any issues.
Replicated on both: 1.2.0 and 2.0.0
Scala version: 2.13.8
Sbt version: 1.4.9
Logback version: 1.4.4
org.slf4j.slf4j-api version: 2.0.3
Related stackoverflow issue: https://stackoverflow.com/questions/73727791/sbt-assembly-logback-does-not-work-with-%C3%BCber-jar (not mine)
What's more I'm pretty sure it worked as expected before slf4j upgrade to version 2.x.x.
Mateusz Szmal commented
Closing as migrating
case PathList("META-INF", _*) => MergeStrategy.discard
to
case PathList("META-INF", xs@_*) =>
(xs map {_.toLowerCase}) match {
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.discard
}
helped