Skip to content

Commit

Permalink
[logging] Use Log4j2's BOM to ensure that Log4j2 version is consisten…
Browse files Browse the repository at this point in the history
…t. Replace legacy log4j with log4j-1.2-api

backports PR apache#8880 to branch-2.7
[logging] Upgrade Log4j2 version to 2.14.0, replace legacy log4j dependency with log4j-1.2-api (apache#8880)

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it

(cherry picked from commit 2e1fb05)
(cherry picked from commit 6fee20f)
  • Loading branch information
lhotari authored and nicoloboschi committed Dec 10, 2021
1 parent 460dd4b commit f056e84
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 46 deletions.
6 changes: 3 additions & 3 deletions buildtools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.10.0</version>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.10.0</version>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.10.0</version>
<version>2.15.0</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions distribution/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
</dependency>

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

<dependency>
Expand Down
10 changes: 5 additions & 5 deletions distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ The Apache Software License, Version 2.0
- jakarta.validation-jakarta.validation-api-2.0.2.jar
- javax.validation-validation-api-1.1.0.Final.jar
* Log4J
- log4j-log4j-1.2.17.jar
- org.apache.logging.log4j-log4j-api-2.10.0.jar
- org.apache.logging.log4j-log4j-core-2.10.0.jar
- org.apache.logging.log4j-log4j-slf4j-impl-2.10.0.jar
- org.apache.logging.log4j-log4j-web-2.10.0.jar
- org.apache.logging.log4j-log4j-api-2.15.0.jar
- org.apache.logging.log4j-log4j-core-2.15.0.jar
- org.apache.logging.log4j-log4j-slf4j-impl-2.15.0.jar
- org.apache.logging.log4j-log4j-web-2.15.0.jar
- org.apache.logging.log4j-log4j-1.2-api-2.15.0.jar
* Java Native Access JNA -- net.java.dev.jna-jna-4.2.0.jar
* BookKeeper
- org.apache.bookkeeper-bookkeeper-common-4.14.3.jar
Expand Down
4 changes: 2 additions & 2 deletions managed-ledger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
</dependency>

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

Expand Down
37 changes: 3 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -574,41 +574,10 @@ flexible messaging model and an intuitive client API.</description>

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

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

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>

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

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<type>test-jar</type>
<version>${log4j2.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<type>test-jar</type>
<version>${log4j2.version}</version>

<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
Expand Down

0 comments on commit f056e84

Please sign in to comment.