March 17, 2005

Log4J Considered Harmful

The pretentiousness of the title is purely a reflection of a sleepless night, a day before go-live.

Whenever I have faced jar hell during java development, it’s always turned out to be due to Log4J; which is a shame, since log4j is, for good reason, the leader among Java logging tools. Having spent a few tense hours recently with this, I thought I should blog it for the benefit of other unwary souls out there!

So did you know that if you had multiple versions of log4j in you classpath, you are likely to get

java.lang.VerifyError: (class: org/apache/log4j/LogManager,
   method: <clinit> signature: ()V) Incompatible argument to function
        at org.apache.log4j.Logger.getLogger(Logger.java:94)
 


This seems to be a reasonably common occurance, but try telling that to the log4j developers.

And no, I havent found a solution, except forcibly remove the log4j dependency :(

Posted by aviks at March 17, 2005 07:45 PM
Comments