Apache logging services logo Apache log4j logo

Log4j Runtime Dependencies

Some Log4J features depend on external libraries. This page lists the required and optional dependencies.

log4j-api

The Log4J API module has no external dependencies.

log4j-core

The Log4J Implementation has several optional dependencies. See the Dependency Tree for the exact list of JAR files needed for these features.

Optional Dependencies per Feature in Log4J Implementation
Feature Requirements
XML configuration -
JSON configuration Jackson Data Processor
YAML configuration Jackson YAML data format
Async Loggers LMAX Disruptor
SMTP Appender an implementation of javax.mail
JMS Appender a JMS broker like Apache ActiveMQ
Windows color support Jansi
JDBC Appender a JDBC driver for the database you choose to write events to
JPA Appender the Java Persistence API classes, a JPA provider implementation, and a decorated entity that the user implements. It also requires an appropriate JDBC driver

log4j-jcl

The Commons Logging Bridge requires Commons Logging. See the Dependency Tree for the exact list of JAR files needed.

log4j-1.2-api

The Log4j 1.2 Bridge has no external dependencies. This only requires the Log4j API and Log4j Core.

log4j-slf4j-impl

The Log4j 2 SLF4J Binding depends on the SLF4J API. See the Dependency Tree for the exact list of JAR files needed.

Do not use this with the log4j-to-slf4j module.

log4j-jul

The Log4j 2 Java Util Logging Adapter has no external dependencies. It optionally depends on the Log4j Core library. The only required module is the Log4j API.

log4j-to-slf4j

The Log4j 2 to SLF4J Adapter requires the SLF4J API and an SLF4J implementation. See the Dependency Tree for the exact list of JAR files needed.

Do not use this with the log4j-slf4j-impl module.

log4j-flume-ng

The Flume Appender requires Apache Flume and Apache Avro. The persistent agent uses Berkeley DB. See the Dependency Tree for the exact list of JAR files needed.

log4j-taglib

The Log4j Log Tag Library requires the Jakarta Commons Log Taglib and the Servlet API. See the Dependency Tree for the exact list of JAR files needed.

log4j-jmx-gui

The Log4j JMX GUI requires the JConsole jar when run as a JConsole plugin. Otherwise it has no external dependencies. See the Dependency Tree for the exact list of JAR files needed.

log4j-web

The Log4j Web module requires the Servlet API. See the Dependency Tree for the exact list of JAR files needed. Note that this works with the Servlet 2.5 API as well as the Servlet 3.x API.

log4j-nosql

The Log4J NoSQL Appenders module has several optional dependencies. See the Dependency Tree for the exact list of JAR files needed for these features.

Optional Dependencies per Feature in Log4J NoSQL Appenders
NoSQL Appender with MongoDB provider the MongoDB Java Client driver
NoSQL Appender with Apache CouchDB provider the LightCouch CouchDB client library

log4j-iostreams

The Log4j IO Streams module has no external dependencies. This only requires the Log4j API.