I haven't looked into the JDK 1.4 logging features in depth, but they are more powerful that the log method in the GenericServlet class. I guess it depends on what you are trying to do. The GenericServlet class is going to be the easiest to use since there is no class importing to worry about. If I were using JDK 1.4 I would probably choose that over log4j since it is part of the standard java package.
Joined: Sep 20, 2001
Thanks Matthew. JDK 1.4 logger API is really nice. I was just wandering if log4j has something special. If not people may just forget about it and use JDK logger API.
I think the jdk1.4 logging api is very similar to log4j. I have worked a bit with log4j but have only browsed the jdk api so I cannot give a definitive answer but they do seem very similar and I cannot off the top of my head think of something log4j offers that is not in jdk1.4. [ August 06, 2002: Message edited by: timothy zimmerman ]
I use jakarta commons logging in all my lowlevel stuff so they can be reused everywhere; I tend to use log4j as my default logging system on top of this.
Joined: Aug 06, 2002
Originally posted by timothy zimmerman: I cannot off the top of my head think of something log4j offers that is not in jdk1.4. [ August 06, 2002: Message edited by: timothy zimmerman ]
Logging to NT event logs, Chainsaw to merge logs from servers in a cluster into one place, ability to specify rolling logs that get replaced every hour, fancy html output, etc. All at the price of configuration file effort.
subject: Which log() to use? JDK, Servlet, or log4j?