RE: [OJB-developers] Using Log4j
Brought to you by:
thma
From: <ber...@wa...> - 2001-11-21 17:08:17
|
Rainer, I don't about this "LumberJack" project because the logging api didn't exist when I started using log4j. There is an interesting comment about log4j and the jdk 1.4 on the log4j web page, http://jakarta.apache.org/log4j/docs/critique.html maybe you will understand it all, I don't. The project you are referring about is mentioned in the document. They argue that, as sun has put the api in the java namespace it is not trivial to emulate it for earlier version. One thing that might be important is that Log4j is a stable and mature package, used in project like Tomcat and Jboss. Bertrand "Bischof, Rainer" To: ber...@wa..., obj...@li... <rainer.bischo cc: f...@ed...> Subject: RE: [OJB-developers] Using Log4j 21/11/2001 17:51 Bertrand, as you may know the upcoming JDK 1.4 will introduce a complete logging framework. I know this does not really help if you are tied to pre-1.4 versions. But there is a logging package called "LumberJack" out there on http://sourceforge.net/projects/javalogging/ which implements the same API as the upcoming JDK 1.4. If we use this API we can easily switch to the new logging framework when 1.4 is the de-facto standard. cu rb Rainer Bischof EDS - Electronic Data Systems European Automotive Solution Center - Distributed Solutions -----Original Message----- From: ber...@wa... [mailto:ber...@wa...] Sent: Mittwoch, 21. November 2001 17:11 To: obj...@li... Subject: [OJB-developers] Using Log4j Hi Thomas, Did you ever thought about using Log4j in your project. (http://jakarta.apache.org/log4j/docs/manual.html) Looking at the source I see quite often see things like catch (Exception e ) { System.err.println(e.) ..... } or if (debug) { System.err.println(xxx) } I've used log4j in some of my projets and it has the following advantages: You can have a better control on wat should be printed out with 4 levels of logging debug, info, warn, error You can use a configuration file (property file or xml) to change the level of logging so you don't need the setDebug and if (debug) You can use te same configuration file to tell the format of a line, for example adding a time stamp, the threat name,... My favorite is that you can control where message are going to, the console, a file, unix syslogd. The main disadvantage is that you are creating a dependency on a external package but it comes from the Jakarta project and is well supported. and of course that some code need to be changed, but most of it is repetitive; Add a static Category class member to some classes and replace the System.err with CAT.info or CAT.debug,.... Thank you for the great code you are writing Bertrand _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |