Dmytro Chyzhykov's Blog

Yet another programmer.

A Brand New Log4j 2 and Its SLF4J Binding

The first release candidate of the brand new Log4j 2 is Available on Maven Central.

As its early adopters we’ve already started using it in our project. But we also use SLF4J widely in applications.

Here is a list of dependencies which should be added to your pom.xml if you want to use Log4j 2 in conjunction with SLF4J.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- log4j 2 to slf4j bridge -->
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-slf4j-impl</artifactId>
    <version>2.0-rc1</version>
</dependency>

<!-- core api log4j 2 dependencies -->
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.0-rc1</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.0-rc1</version>
</dependency>

Read also:
- Log4j 2 Manual
- Log4j 2 Maven and Ivy Artifacts