Components

The Log4j 2 distribution contains the following artifacts:

jul-to-log4j

JPMS module

org.apache.logging.jul.tolog4j

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

See Installing the JUL-to-Log4j API bridge on how to install it or Using j.u.l.LogManager for more details.

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

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:jul-to-log4j'

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:

  • Maven

  • Gradle

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-bom</artifactId>
      <version>3.0.0-beta3</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</dependencyManagement>
dependencies {
  implementation platform('org.apache.logging.log4j:log4j-bom:3.0.0-beta3')
}

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-async-logger

JPMS module

org.apache.logging.log4j.async.logger

The log4j-async-logger artifact contains the implementation of the asynchronous loggers.

See asynchronous loggers for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-async-logger</artifactId>
  <scope>runtime</scope>
</dependency>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-async-logger'

log4j-compress

JPMS module

org.apache.logging.log4j.compress

The log4j-compress artifact provides additional compression algorithms. Having this artifact in the classpath makes these automatically accessible to Rolling file appenders. See Compressing archived files for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-compress'

log4j-config-jackson

JPMS module

org.apache.logging.log4j.config.jackson

The log4j-config-jackson artifact contains base classes to develop ConfigurationFactory plugins based on Jackson datatype modules.

The log4j-config-yaml and log4j-config-properties artifacts use log4j-config-jackson.

See Extending ConfigurationFactory for more details on how to create your own configuration file formats.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-config-jackson</artifactId>
</dependency>

We assume you use log4j-bom for dependency management.

api 'org.apache.logging.log4j:log4j-config-jackson'

log4j-config-properties

JPMS module

org.apache.logging.log4j.config.properties

The log4j-config-properties artifact provides support for the Java properties configuration file format.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-config-properties</artifactId>
  <scope>runtime</scope>
</dependency>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-config-properties'

log4j-config-yaml

JPMS module

org.apache.logging.log4j.config.yaml

The log4j-config-properties artifact provides support for the YAML configuration file format.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-config-yaml</artifactId>
  <scope>runtime</scope>
</dependency>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-config-yaml'

log4j-conversant

JPMS module

org.apache.logging.log4j.conversant

The log4j-conversant artifact contains a blocking queue factory that uses Conversant Disruptor BlockingQueue.

See Conversant Disruptor Blocking Queue for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-conversant'

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.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-core'

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.

  • Maven

  • Gradle

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>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-core-test'

log4j-csv

The log4j-csv artifact contains layouts that format log events using Commons CSV.

See CSV Layouts for more details.

JPMS module

org.apache.logging.log4j.csv

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-csv'

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.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-docker'

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.

  • Maven

  • Gradle

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>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-flume-ng'

log4j-jctools

JPMS module

org.apache.logging.log4j.jctools

The log4j-jctools artifact contains a blocking queue factory that uses JCTools.

See JCTools Blocking Queue for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jctools'

log4j-jdbc

JPMS module

org.apache.logging.log4j.jdbc

The log4j-jdbc artifact contains an appender that write to a JDBC database.

See JDBC Appender for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jdbc'

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 JNDI.

See DataSource connection source for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jdbc-jndi'

log4j-jdbc-jndi

JPMS module

org.apache.logging.log4j.jdbc.jndi

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

See PoolingDriver connection source for more details.

  • Maven

  • Gradle

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>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jdbc-dbcp2'

log4j-jndi

JPMS module

org.apache.logging.log4j.jndi

The log4j-jndi adds JNDI support to several Log4j components:

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jndi'

log4j-jpl

JPMS module

org.apache.logging.log4j.jpl

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

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jpl'

log4j-jul

JPMS module

org.apache.logging.log4j.jul

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

See Using j.u.l.Handler for more details.

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

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-jul'

log4j-kit

JPMS module

org.apache.logging.log4j.kit

The log4j-kit artifact provides tools to write modern, garbage-free implementations of the Log4j API.

Log4j Core 3 is based on this artifact.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-kit'

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.

  • Maven

  • Gradle

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>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-layout-template-json'

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.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-mongodb4'

log4j-plugin-processor

JPMS module

org.apache.logging.log4j.plugin.processor

The log4j-plugin-processor contains an annotation processor used to compile Log4j plugins.

See Extending Log4j for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-plugin-processor</artifactId>
  <scope>runtime</scope>
</dependency>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-plugin-processor'

log4j-plugins

JPMS module

org.apache.logging.log4j.plugins

The log4j-plugins artifact contains a small Dependency Injection framework used by Log4j Core 3.

See Architecture for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-plugins'

log4j-script

JPMS module

org.apache.logging.log4j.script

The log4j-script artifact enables JSR 223 support in many Log4j components. It is required by:

See Scripts for more details.

  • Maven

  • Gradle

We assume you use log4j-bom for dependency management.

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

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-script'

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.

  • Maven

  • Gradle

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>

We assume you use log4j-bom for dependency management.

runtimeOnly 'org.apache.logging.log4j:log4j-spring-cloud-config-client'