Components
The Log4j 2 distribution contains the following artifacts:
jul-to-log4j
JPMS module |
|
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-async-logger
JPMS module |
|
---|
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 |
|
---|
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 |
|
---|
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.
log4j-config-properties
JPMS module |
|
---|
The log4j-config-properties
artifact provides support for the Java properties configuration file format.
See predefined ConfigurationFactory
plugins for more details.
-
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 |
|
---|
The log4j-config-properties
artifact provides support for the YAML configuration file format.
See predefined ConfigurationFactory
plugins for more details.
-
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 |
|
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 |
|
---|
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 |
|
---|
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 |
|
---|
-
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 |
|
---|
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 |
|
---|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
The log4j-jndi
adds JNDI support to several Log4j components:
-
It provides the JNDI lookup.
-
It provides a JNDI data source for the JDBC Appender.
-
It is internally used by the JMS appender.
-
It provides a JNDI context selector.
-
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 |
|
The log4j-jpl
artifact contains a bridge from
System.Logger
to the Log4j API.
See Installing the JPL-to-Log4j API bridge for more details.
-
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 |
|
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
|
-
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 |
|
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 |
|
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 |
|
---|
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 |
|
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 |
|
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 |
|
The log4j-script
artifact enables JSR 223 support in many Log4j components.
It is required by:
-
scripting support for the Routing Appender,
-
scripting support for the rolling file appenders.
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 |
|
---|
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'