Log4j vs Java 1.4 Logging - Is there a difference?·
In the past, whenever I’ve done logging within a project, I’ve used log4j as my preferred logging package. This has been primarily for historical reasons as I started developing with Java before the JDK 1.4 logging package was available.
Earlier this week, my RSS aggregator popped up informing me that a new version of log4j (1.2.13) had been released.
It then occurred to me, is there a need for log4j anymore? I primarily target Java 1.4 and 5 VM’s so I don’t need to worry about the JDK logging package not being available.
The log4j wiki has a page that attempts to answer this question and provides good reasoning for using log4j instead of Java logging, however I get the impression that these arguments are somewhat out of date.
What is your preference for logging API? Are there any up-to-date comparisons?
At the moment, I’m sticking with log4j, but I couldn’t honestly say whether this is the best approach or not.