Yes, I've used it on a couple of projects and I LOVE it. I'm recommending it for every project now. The coolest features are the way it automatically "filters" levels of what goes to output without having to put that in your code, and the ability to go to multiple destinations (files, sockets, etc....) Kyle ------------------ Kyle Brown, Author of Enterprise Java (tm) Programming with IBM Websphere See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
Hi Kyle, I've created a new project in VisualAge called Log4J and imported the log4j.jar into this new project. It complained that there's a problem with the SMTPAppender class. Did you encounter this?
Joined: Aug 10, 2001
My guess is that you need to import Sun's javamail classes... I generally have them in another project too, so I haven't seen this yet. I doublechecked in my VAJ workbench and just confirmed that this is true -- you get the error if you remove the Javamail classes, but it disappears if you re-add them. Kyle ------------------ Kyle Brown, Author of Enterprise Java (tm) Programming with IBM Websphere See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information. [This message has been edited by Kyle Brown (edited November 17, 2001).]
Joined: Sep 14, 2001
Thanks Kyle for you help. I played with it last weekend and wow, it is pretty good! Instead of using System.out to print out info messages I can now use these five methods: logDebug, logInfo, logWarning, logError, and logFatal. My config file sets up which files are being logged to, and what severity of messages are being logged. Really cool! The only problem now is how to sell this idea to the rest of the team. Can i say that this is the de-facto standard now in the industry?
If you are going to use Log4J on a jsp page then you really neeed to get the Loggin TagLib. With that you don't write scriptlets to log a message you just put in a tag like < log:debug message="this is a message"/> It also has a tag that allows quick Dumping of all variables in a given scope to the log file.
Although it may not be pervasive enough to be called the de facto standard, it probably is the most popular logging solution after System.out. To convince your colleagues you might point out that it was a major inspiration behind the Java 1.4 Logging API. Indeed, the resemblance is striking. - Peter