Hi Chris,
Thanks for your suggestions. After reading through your references I
came to the conclusion (I think) that I don't need a 'bridge' - all I
need to do is get the slf4j-log4j12 jar off the classpath.
Here's how I did it:
1) in ~/.ivy2/cached there are a whole load of xml files that describe
the transitive dependencies. Browsing through there I saw that a
library I was including (eu.medsea.mimeutil.mime-util) was pulling in
slf4j-log4j12
2) To stop sbt from adding slf4j-log4j12.jar into the war file, I
added
ivyXML := <dependencies>
<dependency org="eu.medsea.mimeutil" name="mime-util"
rev="2.1.3" >
<exclude module="slf4j-log4j12" />
</dependency>
</dependencies>
into build.sbt (for sbt 0.10.1)
Bingo - all seems to work fine now!
Thanks again for the help.
Damian.
On Aug 3, 1:03 pm, Christopher Taylor <
ccmtay...@gmail.com> wrote:
> in general, I try to have only one logging backend implementation
> (logback/slf4j-log4j/slf4j-jcl) on the classpath and use the slf4j
> bridges (*-over-slf4j) to redirect the other apis to slf4j. The
> diagram at [1] explains this approach very well.
>
> I've run into problems where various libs pull in commons-logging via
> transitive dependencies. For maven, you can use exclusions[2] to get
> rid of it again (not sure whether/how sbt supports this);
> alternatively you can include a dependency on a "fake" c-l
> implementation to override the transitive dep [3], or include a
> dependency with scope "provided" [4].
>
> Hope that helps and regards,
> --Chris
>
> [1]:
http://www.slf4j.org/legacy.html
> [2]:
http://maven.apache.org/guides/introduction/introduction-to-optional-...
> [3]:
http://day-to-day-stuff.blogspot.com/2007/10/announcement-version-99-...
> [4]:
http://www.insaneprogramming.be/?p=111(see "update" at the end