This post originated from an RSS feed registered with Java Buzz
by Joey Gibson.
Original Post: Tracking Down a Log4J Problem
Feed Title: Joey Gibson's Blog
Feed URL: http://www.jobkabob.com/index.html
Feed Description: Thoughts, musings, ramblings and rants on Java, Ruby, Python, obscure languages, politics and other exciting topics.
I had a really interesting time tracking down a Log4J
problem. We've been using Log4J for over a year now happily and even
happier with the Commons
Logging package on top of it. But last week (while I was on
vacation) something went pear shaped: the logs got created but after
some initial log messages got sent to the logs, no further messages
would get logged. I checked the config file (the XML variety, not the
properties file) and it was correct. I then set about digging through
code to see if someone had programatically changed the logger, but
found nothing. Finally today I found the culprit: a rogue
log4j.properties file in a war file in our ear file (that had been
there the whole time) had been changed to set the root
logger to a level of WARN. Since all of our log messages are
at INFO level, thus they never made it. I've tested this and it is
indeed the problem.
That was a real pain to diagnose, especially since
the offending file had not been checked into our source
repository. Had it been checked in, I probably would have spotted the
change sooner.