Because event logging is often an afterthought, Java developers often ignore this task while programming. However, logging allows developers to instrument their code so the operations staff can deal with any problems that arise. In this article, Nate Sammons introduces Syslog, a robust logging system that divorces the act of logging an event from the handling of that event. You'll learn how to easily integrate the Syslog package into your Java programs and how to leverage Syslog as an integral part of new system development. (4,800 words)
Log4j, an open source project, allows developers to control which log statements are output with arbitrary granularity. It's fully configurable at runtime by using external configuration files. Best of all, log4j has a gentle learning curve. Beware: judging from user feedback, it is also quite addictive. Project founder Ceki Gulcu describes the log4j API, its unique features, and its design rationale. (3,400 words)
Application logging is a significant component in software development and always vital for an application's health. The traditional logging services are synchronous and prove to be an overhead especially in mission-critical states. Traditional logging does not provide distributed logging services effectively. In a distributed computing environment such as J2EE, clients are expected to log to a central database concurrently. J2EE architectures do not advocate logging to files or consoles. By taking advantage of Java Message Service (JMS), you can replace traditional synchronous logging with asynchronous logging. Asynchronous logging decouples clients from the log service, allowing nonblocking operations. The critical data is delivered once and only once in a guaranteed mode to the destination. The log messages can then be persisted using Hibernate with ease and comfort. This article develops such a log service using JMS and Hibernate. (2,100 words; May 10, 2004)