[slf4j-user] slf4j and log4j - log4j exclusion question

Ceki Gülcü ceki at qos.ch
Tue Jun 24 14:27:07 CEST 2014


Sounds like a SBT issue rather than a problem with slf4j.

On 5/9/2014 21:36, Adrian Mocanu wrote:
> I have a few projects that use log4jOverSlf4j and other that use slf4j-log4j so I'm getting a circular loop.
>
> I have this dependency tree in my spark-core jar and I want to remove the lines marked with <------------------------------
>
> [info]   +-org.apache.spark:spark-core_2.10:0.9.1 [S]
> [info]   | +-org.apache.zookeeper:zookeeper:3.4.5
> [info]   | | +-jline:jline:0.9.94
> [info]   | | | +-junit:junit:3.8.1 (evicted by: 4.11)
> [info]   | | | +-junit:junit:4.11
> [info]   | | |   +-org.hamcrest:hamcrest-core:1.3
> [info]   | | |
> [info]   | | +-log4j:log4j:1.2.17   <------------------------------
> [info]   | | +-org.jboss.netty:netty:3.2.2.Final
> [info]   | | +-org.slf4j:slf4j-api:1.7.2 (evicted by: 1.7.5)
> [info]   | | +-org.slf4j:slf4j-api:1.7.5
> [info]   | | +-org.slf4j:slf4j-log4j12:1.7.2   <------------------------------
> [info]   | |   +-log4j:log4j:1.2.17
> [info]   | |   +-org.slf4j:slf4j-api:1.7.2 (evicted by: 1.7.5)
> [info]   | |   +-org.slf4j:slf4j-api:1.7.5
> [info]   | |
> [info]   | +-org.scala-lang:scala-library:2.10.3 (evicted by: 2.10.4)
> [info]   | +-org.slf4j:slf4j-api:1.7.2 (evicted by: 1.7.5)
> [info]   | +-org.slf4j:slf4j-api:1.7.5
> [info]   | +-org.slf4j:slf4j-log4j12:1.7.2  <------------------------------
> [info]   | | +-log4j:log4j:1.2.17
> [info]   | | +-org.slf4j:slf4j-api:1.7.2 (evicted by: 1.7.5)
> [info]   | | +-org.slf4j:slf4j-api:1.7.5
> [info]   | |
>
>
> In sbt I used exclusion rule (http://www.scala-sbt.org/0.12.2/api/sbt/ExclusionRule.html) like this to get rid of the log4j line and it worked:
> val spark="org.apache.spark" % "spark-core_2.10" % "0.9.1" excludeAll(
>      ExclusionRule(name = "log4j"),
>      ExclusionRule(name = "org.slf4j")
> )
>
> I still have org.slf4j:slf4j-log4j12:1.7.2  lines and I can't figure out how to get rid of them.
> I tried exluding everything I can think of and to no avail:
>
>      ExclusionRule("org.slf4j"),
>      ExclusionRule("org.apache.zookeeper", "log4j"),
>      ExclusionRule("org.apache.zookeeper", "org.slf4j"),
>      ExclusionRule("org.apache.zookeeper", "org.slf4j","slf4j-log4j12"),
>      ExclusionRule("org.apache.zookeeper", "org.slf4j","*"),
>      ExclusionRule("org.slf4j", "*", "*"),
>      ExclusionRule("org.slf4j","*"),
>      ExclusionRule("*","org.slf4j"),
>      ExclusionRule("*","*","org.slf4j"),
>      ExclusionRule("org.slf4j","slf4j-log4j12")
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
>


More information about the slf4j-user mailing list