Components

The Log4j 2 distribution contains the following artifacts:

log4j-bom

A public Bill-of-Materials that manages all the versions of Log4j artifacts. You can import the BOM in your build tool of preference:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-bom</artifactId>
      <version>2.24.3</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</dependencyManagement>
xml

log4j

A private Bill-of-Materials used during the compilation and testing of the project.

Do not use this artifact, since it also manages versions of third-party projects. Use log4j-bom instead.

log4j-1.2-api

JPMS module

org.apache.log4j

The log4j-1.2-api artifact contains several tools to help users migrate from Log4j 1 to Log4j 2.

See Log4j 1 to Log4j 2 Bridge for details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-1.2-api</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-api

JPMS module

org.apache.logging.log4j

The log4j-api artifact contains the Log4j API.

See Log4j API for more details.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-api</artifactId>
  <version>${log4j-api.version}</version>
</dependency>
xml

log4j-api-test

JPMS module

org.apache.logging.log4j.test

The log4j-api-test artifact contains test fixtures useful to test Log4j API implementations.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-api-test</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-appserver

JPMS module

org.apache.logging.log4j.appserver

The log4j-appserver artifact contains:

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-appserver</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-cassandra

JPMS module

org.apache.logging.log4j.cassandra

The log4j-cassandra artifact contains an appender for the Apache Cassandra database.

See Cassandra Appender for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-cassandra</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-core

JPMS module

org.apache.logging.log4j.core

The log4j-core artifact contains the reference implementation of the Log4j API.

See Reference implementation for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-core-test

JPMS module

org.apache.logging.log4j.core.test

The log4j-core-test artifact contains test fixtures useful to extend the reference implementation.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core-test</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-couchdb

JPMS module

org.apache.logging.log4j.couchdb

The log4j-couchdb artifact contains a provider to connect the NoSQL Appender with the Apache CouchDB database.

See CouchDB provider for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-couchdb</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-docker

JPMS module

org.apache.logging.log4j.docker

The log4j-docker artifact contains a lookup for applications running in a Docker container

See Docker lookup for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-docker</artifactId>
  <version>2.24.3</version>
  <scope>runtime</scope>
</dependency>
xml

log4j-flume-ng

JPMS module

org.apache.logging.log4j.flume

The log4j-flume-ng artifact contains an appender for the Apache Flume log data collection service.

See Flume Appender for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-flume-ng</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-iostreams

JPMS module

org.apache.logging.log4j.iostreams

The log4j-iostreams artifact is an extension of the Log4j API to connect with legacy stream-based logging methods.

See Log4j IOStreams for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-iostreams</artifactId>
</dependency>
xml

log4j-jakarta-smtp

JPMS module

org.apache.logging.log4j.jakarta.smtp

The log4j-jakarta-smtp contains an appender for the Jakarta Mail 2.0 API and later versions.

See SMTP Appender for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jakarta-smtp</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jakarta-web

JPMS module

org.apache.logging.log4j.jakarta.web

The log4j-jakarta-web contains multiple utils to run your applications in a Jakarta Servlet 5.0 or later environment:

Don’t deploy this artifact together with log4j-web.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jakarta-web</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jcl

JPMS module

org.apache.logging.log4j.jcl

The log4j-jcl artifact contains a bridge from Apache Commons Logging and the Log4j API.

See Installing JCL-to-Log4j API bridge for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jcl</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jdbc-dbcp2

JPMS module

org.apache.logging.log4j.jdbc.dbcp2

The log4j-jdbc-dbcp2 artifact contains a data source for the JDBC Appender that uses Apache Commons DBCP.

See PoolingDriver connection source for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jdbc-dbcp2</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jpa

JPMS module

org.apache.logging.log4j.jpa

The log4j-jpa artifact contains an appender for the Jakarta Persistence 2.2 API or Java Persistence API.

See JPA Appender for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jpa</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jpl

JPMS module

org.apache.logging.log4j.jpl

The log4j-jpl artifact contains a bridge from System.Logger to the Log4j API.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jpl</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-jul

JPMS module

org.apache.logging.log4j.jul

The log4j-jul artifact contains a bridge from java.util.logging to the Log4j API.

Don’t deploy this artifact together with log4j-to-jul.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-jul</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-layout-template-json

JPMS module

org.apache.logging.log4j.json.template.layout

The log4j-layout-template-json contains a highly extensible and configurable layout to format log events as JSON.

See JSON Template Layout for details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-layout-template-json</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-mongodb

JPMS module

org.apache.logging.log4j.mongodb

The log4j-mongodb artifact contains a provider to connect the NoSQL Appender with the MongoDB database. It is based on the latest version of the Java driver.

See MongoDb provider for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-mongodb</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-mongodb4

JPMS module

org.apache.logging.log4j.mongodb4

The log4j-mongodb artifact contains a provider to connect the NoSQL Appender with the MongoDB database. It is based on version 4.x of the Java driver.

See MongoDb4 provider for more information.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-mongodb4</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-slf4j2-impl

JPMS module

org.apache.logging.log4j.slf4j2.impl

The log4j-slf4j2-impl artifact contains a bridge from SLF4J 2 API to the Log4j API.

Don’t deploy this artifact together with either log4j-slf4j-impl or log4j-to-slf4j.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-slf4j2-impl</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-slf4j-impl

JPMS module

org.apache.logging.log4j.slf4j.impl

The log4j-slf4j-impl artifact contains a bridge from SLF4J 1 API to the Log4j API.

Don’t deploy this artifact together with either log4j-slf4j2-impl or log4j-to-slf4j.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-slf4j-impl</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-spring-boot

JPMS module

org.apache.logging.log4j.spring.boot

The log4j-spring-boot artifact contains multiple utils to integrate with Spring Framework 5.x or earlier versions and Spring Boot 2.x or earlier versions.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-spring-boot</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-spring-cloud-config-client

JPMS module

org.apache.logging.log4j.spring.cloud.config.client

The log4j-spring-cloud-config-client provides utils to integrate with Spring Cloud Config 3.x or earlier versions.

See Log4j Spring Cloud Configuration for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-spring-cloud-config-client</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-taglib

JPMS module

org.apache.logging.log4j.taglib

The log4j-taglib provides a Jakarta Servlet Pages 2.3 or earlier library that logs to the Log4j API.

See Log4j Taglib for more details.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-taglib</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-to-jul

JPMS module

org.apache.logging.log4j.to.jul

The log4j-jul artifact contains an implementation of the Log4j API that logs to java.util.logging.

See Installing JUL for more details.

Don’t deploy this artifact together with log4j-jul.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-to-jul</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-to-slf4j

JPMS module

org.apache.logging.log4j.to.slf4j

The log4j-jul artifact contains an implementation of the Log4j API that logs to SLF4J API.

See Installing Logback for more details.

Don’t deploy this artifact together with either log4j-slf4j-impl or log4j-slf4j2-impl.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-to-slf4j</artifactId>
  <scope>runtime</scope>
</dependency>
xml

log4j-web

JPMS module

org.apache.logging.log4j.web

The log4j-jakarta-web contains multiple utils to run your applications in a Jakarta Servlet 4.0 or Java EE Servlet environment:

Don’t deploy this artifact together with log4j-jakarta-web.

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-web</artifactId>
  <scope>runtime</scope>
</dependency>
xml