Java Logging Reconsidered - The Technical Times of Michael Andrews
Java Logging Reconsidered
For some time now I have been a bit perplexed about logging in Java. Not only does it seem overly complicated, but the community is fragmented around all the different frameworks, wrappers, and implementations. So I thought I would sit down and try to learn the history, understand the pros and cons of each framework, and determine my preferred logging ecosystem.
Log4J
From what I understand, in 1996, JDK 1.0.2 did not have a logging framework. It basically leveraged System.out and System.err for logging. This shortcoming led to the Jakarta project "Log for Java" (log4j), which in 1999 provided a robust concrete logging implementation. It was continuously developed through 2008 and has become widely adopted.
Log4J Pros:
- Fast.
- Thread safe.
- Multiple loggers.
- Multiple log levels.
- Multiple appenders: file, db, email, remote systems, etc.
- Simple runtime configuration.
Log4J Cons:
- Does not provide asynchronous logging.
- No longer being developed (as far as I can tell).
- One COULD argue that it is hard to extend. So I will too. :)
Read full article from Java Logging Reconsidered - The Technical Times of Michael Andrews
No comments:
Post a Comment