*** Welcome to piglix ***

Log4j

Apache Log4j
Apache Log4j Logo.png
Developer(s) Apache Software Foundation
Initial release January 8, 2001; 16 years ago (2001-01-08)
Stable release
2.8.1 / February 26, 2017 (2017-02-26)
Written in Java
Operating system Cross-platform
Type Logging Tool
License Apache License 2.0
Website http://logging.apache.org/log4j

Apache Log4j is a Java-based logging utility. It was originally written by Ceki Gülcü and is now a project of the Apache Software Foundation. Log4j is one of several Java logging frameworks.

Gülcü has since started the SLF4J and Logback projects, with the intention of offering a successor to Log4j.

The Apache Log4j team has created a successor to Log4j 1 with version number 2. Log4j 2 was developed with a focus on the problems of Log4j 1.2, 1.3, java.util.logging and Logback, and addresses issues which appeared in those frameworks. In addition, Log4j 2 offers a plugin architecture which makes it more extensible than its predecessor. Log4j 2 is not backwards compatible with 1.x versions, although an "adapter" is available.

On August 5, 2015 the Apache Logging Services Project Management Committee announced that Log4j 1 had reached end of life and that users of Log4j 1 are recommended to upgrade to Apache Log4j 2.

Apache Log4j 2 is the successor of Log4j 1 which was released as GA version in July 2014. The framework was rewritten from scratch and has been inspired by existing logging solutions, including Log4j 1 and java.util.logging. The main differences to Log4j 1 are:

One of the most recognized features of Log4j 2 is the performance of the "Asynchronous Loggers". Log4j 2 makes use of the LMAX Disruptor. The library reduces the need for kernel locking and increases the logging performance by a factor 12. For example, in the same environment Log4j 2 can write more than 18,000,000 messages per second, whereas other frameworks like Logback and Log4j 1 just write < 2,000,000 messages per second.

The following table defines the built-in log levels and messages in Log4j, in decreasing order of severity. The left column lists the log level designation in Log4j and the right column provides a brief description of each log level.

Log4j 2 allows users to define their own log levels. A source code generator tool is provided to create Loggers that support custom log levels identically to the built-in log levels. Custom log levels can either complement or replace the built-in log levels.

Log4j can be configured through a configuration file or through Java code. Configuration files can be written in XML, JSON, YAML, or properties file format. Within a configuration you can define three main components: Loggers, Appenders and Layouts. Configuring logging via a file has the advantage that logging can be turned on or off without modifying the application that uses Log4j. The application can be allowed to run with logging off until there's a problem, for example, and then logging can be turned back on simply by modifying the configuration file.


...
Wikipedia

...