Google Suggest Spring 1.1.3 Release
Dec 12

Grrr. Trying to turn off logging messages :)

Tech Add comments

I am running a bunch of tests, and logging messages are spewing all over. Some are annoying INFO messages that I don’t care about.

Everything is plugged into commons-logging -> log4j.

I have the log level turned up for the package that is spewing this information. What is up?

  • I make sure that commons logging is being found in the right classloader. I had a problem where it was loaded in a parent classloader, and hence couldn’t Classloader.getResource*(”log4j.xml”) to get the right file (another annoying problem to hunt down).
  • That wasn’t the problem, so I make sure that the log4j.xml was being found
  • Yup it was happy. Hmm. So why is it logging an element from FooBar.class even though it was in a package that I have told not to log that level?
  • It turned out that the class in question was an abstract base class, which had a getClass() call, when it got the logger object. So, although it looks like that package/class was doing the dead, it was really MY class which inherited from it.
  • I turned the log level up for my own package, and it went away. I wish I could get the source for the offending package and not make it log in that way ;)

Another hour wasted!

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What is the number before 3? (just put in the digit)