views:

14

answers:

1

I am writing a Maven plugin (Mojo) that imports a Jar library used by other projects. At least one of the classes in that library use Apache Log4j for logging, but Log4j is not going to be properly configured by the logger that Maven provides to the Mojo.

Is there any simple way to bridge between these? Unfortunately, org.apache.log4j.Logger and org.apache.maven.logging.Log do not share a common superinterface or superclass, so I can't simply have a setLog() type function. Any suggestions would be welcome; currently I am planning to either just ignore it, or write a bridge class that can use either.

+1  A: 

If you want to write a bridge class, look at SLF4J sources: http://www.slf4j.org/legacy.html#log4j-over-slf4j They are doing something quite similar in their log4j bridge.

mglauche
Not exactly what I was hoping for, but thanks for the info. If nobody else gives a better answer within about a week, I'll accept this one.
Jonathan