[OJB-developers] Log4jLoggerImpl
Brought to you by:
thma
From: <syl...@be...> - 2002-01-18 19:04:18
|
Hi Thomas Here is thelog4jLoggerImpl I told you about. I had to change a few things in other classes to make it work. The main problem was that with log4j you have to give a name the logger (log4j Category) when you create it. You cannot create a category then do a setname() afterwards. So I changed the Logger interface to remove the setname() method. Change PoorMansLoggerImpl so that its constructor did get the name directly and removed the setname() method. I then had to change LoggerFactory to call the constructor with the name as argument. I also found interesting to be able to specify a configuration file for log4j so I changed the PersistenceBrokerFactoryConfiguration to read the LoggerConfigFile property. To help you found the changes I started them with a //bmi comment. Here is a zip file with Logger.java PoorMansLoggerImpl.java LoggerFactory Log4jLoggerImpl.java PersistenceBrokerFactoryConfiguration And two sample configuration file OJB.properties Log4j.properties and log4j.jar just in case Greetings Bertrand |