Avik’s Ruminations

Musings on technology and life by Avik Sengupta

Log4J Considered Harmful

without comments

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:  signature: ()V) Incompatible argument to function
at org.apache.log4j.Logger.getLogger(Logger.java:94)

This seems to be a reasonably common occurrence, but try telling that to the log4j developers.
And no, I havent found a solution, except forcibly remove the log4j dependency 🙁

Written by

March 17th, 2005 at 7:45 pm

Posted in Technology