Up until now, I have used Log4j in most of my development efforts — be they personal, open-source or corporate (there’s an argument I should have been using a logging bridge of some kind, to insulate any 3rd party users of my code from having to use my logging system of choice — but most of the work I’ve been doing hasn’t had a huge number of 3rd party users, so it hasn’t been that much of an issue). However, I recently came across Graham Lea’s simple-log; the basic premise of which appeals to my drive to simplify things as much as possible. So, bye bye, Log4J, it’s been great!
I’m currently running a couple of java applications which rely on the commons-logging bridge, alongside of which I use velocity (which itself uses Avalon LogKit or Log4J by default). In order to integrate simple-log and drop log4j out of my lib path, I need to provide a logging implementation for commons-logging, and also change the default velocity runtime logsystem.
SimpleLogger.java (stick your own package in front of it), does both. To use it, make sure you set the runtime property for commons, e.g.:
-Dorg.apache.commons.logging.Log=yourpackagehere.SimpleLogger
and then set the logsystem for velocity (where ve is the VelocityEngine), using the same property:
ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, System.getProperty('org.apache.commons.logging.Log'))


