Re: [OJB-developers] Using Log4j
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2001-11-22 17:36:59
|
-------- Original Message -------- Subject: Re: [OJB-developers] Using Log4j Date: Wed, 01 Jan 1997 00:51:17 +0100 From: Thomas Mahler <tho...@ho...> Organization: NOORG To: "Bischof, Rainer" <rai...@ed...> References: <412...@es...> Hi all, integrating a proper logging mechanism is on the OJB todo list for one year now... I have been thinking of using Log4j, as I have been using it for other projects as well and like its simple api. There are also a lot of useful LogAppenders available that address a lot of peoples needs. The Lumberjack approach sounds quite promising. I will have a look at it. The main reason why I did not start with integrating logging until now is performance. There are many performance critical parts in OJB that would be dead slow if logging is enabled in a production environment. I have been looking around for a preprocessor for a while that would allow to remove logging instrumentation from production code, but allow a detailed logging in development mode. I just found a very simple preprocessor in the HypersonicSQL project. It allows you to do things like: //#ifdef DEBUG String logMsg = ...; // computing logmessages is often very time consuming logger.debug(logMsg); //#endif by running the CodeSwitcher with a -DEBUG switch you can then disable logging. (The CodeSwitcher just modifies the above code to: //#ifdef DEBUG /* String logMsg = ...; // computing logmessages is often very time consuming logger.debug(logMsg); */ //#endif I already used this preprocessor to turn on JDK1.3 Proxies by default and to use a JDK1.2 based replacement if required. Thanks for your suggestions, Thomas |