Apache logging services logo Apache log4j logo

Log4j 2 Implementation

The Log4j 2 implementation provides the functional components of the logging system. Users are free to create their own plugins and include them in the logging configuration.


As of version 2.4, Log4j 2 requires Java 7. Versions 2.3 and earlier require Java 6. Some features may require optional dependencies. These dependencies are specified in the documentation for those features.

Below is a list of Log4j features that require external dependencies. See the Dependency Tree for the exact list of JAR files needed for these features.

  • JSON configuration requires the Jackson Data Processor.
  • Async Loggers require the LMAX Disruptor.
  • The SMTPAppender requires Javax Mail.
  • The JMSQueueAppender and JMSTopicAppender require a JMS implementation like Apache ActiveMQ.
  • The Kafka appender requires Kafka client library
  • Windows console color support requires Jansi.
  • The JDBC Appender requires a JDBC driver for the database you choose to write events to.
  • The JPA Appender requires the Java Persistence API classes, a JPA provider implementation, and a decorated entity that the user implements. It also requires an appropriate JDBC driver.
  • The NoSQL Appender with MongoDB provider requires the MongoDB Java Client driver.
  • The NoSQL Appender with Apache CouchDB provider requires the LightCouch CouchDB client library.
  • The NoSQL Appender can be customized with a user-supplied provider, which will require the appropriate client library.
  • bzip2, Deflate, Pack200, and XZ compression on rollover requires Apache Commons Compress. In addition, XZ requires XZ for Java.
  • The CSV layout requires the Apache Commons CSV library.
  • The ZeroMQ/JeroMQ requires the JeroMQ library.