RE: [OJB-developers] Using Log4j
Brought to you by:
thma
From: Bischof, R. <rai...@ed...> - 2001-11-21 17:45:18
|
Bertrand, you are right this package namespace issue involves putting the lumberjack classes into the JVM installation path. This is something that is OK for a developer's machine but not 10'000s of client machines or for a server where you don't have access to all files. That's why we moved all classes of this lumberjack package into the namespace of our project when we used it. That way you still have modifications when you finally want to use the JDK1.4 logging but this is reduced to modifications in the import statements. At least for our project this was OK... I am not really happy about this workaround but I guess it is better than to introduce something that will render useless in a few months. Besides: Some comments about limited functionality are not really limitations, like it can only log to console, file and socket. Yes it is true but you can write your own handler that logs to your printer, your logserver or your CDRom if you like. Support for the future de-facto standard will be high in all areas, even if it is probably weaker than Log4J. Same thing as with the common comparison between JSP and the templating systems (http://www.servlets.com/soapbox/problems-jsp.html). The best does not always win ... In the end it's up to Thomas to decide as I guess he will have to perform the work.... Regards 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 18:08 To: Bischof, Rainer; obj...@li... Subject: RE: [OJB-developers] Using Log4j 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 _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |