Discussion: Logging

Posted on Apr 13, 2004

Why bother with commons-logging?

How does being able to select a logging configuration at startup-time benefit me? For the writers of Hibernate, it’s clear. They have downstream users with their own logging needs. For me, I don’t.

As long as I design to an interface, I can remain relatively flexible with regard to logging on my own. If I need to use a new logging system, or switch to use a future JDK’s logging implementation, I can just re-implement the interface.

And it seems like I would be asking for trouble switching to it. I’m getting better at resolving classpath issues, but they can be really tricky to track down at times anyway.

Apache Log4J works quite well for me. That’s what I’ll be using.