The log4j API

The first logging package we will examine is the log4j package from the Apache Jakarta project. This is a mature logging API that provides a rich feature set for formatting and controlling logging activity. Logging output can be directed to one or more logs based on severity levels, the name of the component performing the logging, or any arbitrary filter criteria.

The log4j logging package is flexible. Logging output can be directed to a file (either OutputStream or Writer), a remote log4j server, the UNIX Syslog, or the NT event logger. Various configuration parameters can be changed; for example, you can use different logging devices or log different severity levels. Most configuration changes do not require changes to the code ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.