Skip to content

Commit

Permalink
HADOOP-18088. Replace log4j 1.x with reload4j. (apache#4052)
Browse files Browse the repository at this point in the history
Change-Id: Id2f25f0b9d26e0ff73f828acbfb4e6fbac3425cc
Co-authored-by: Wei-Chiu Chuang <weichiu@apache.org>
  • Loading branch information
2 people authored and steveloughran committed Jun 3, 2022
1 parent a406f49 commit 77081e1
Show file tree
Hide file tree
Showing 37 changed files with 195 additions and 94 deletions.
9 changes: 5 additions & 4 deletions LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/nvd3-1.8.5.* (css and js
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/AbstractFuture.java
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/TimeoutFuture.java

ch.qos.reload4j:reload4j:1.2.18.3
com.aliyun:aliyun-java-sdk-core:3.4.0
com.aliyun:aliyun-java-sdk-ecs:4.2.0
com.aliyun:aliyun-java-sdk-ram:3.0.0
Expand Down Expand Up @@ -279,7 +280,6 @@ io.reactivex:rxjava-string:1.1.1
io.reactivex:rxnetty:0.4.20
io.swagger:swagger-annotations:1.5.4
javax.inject:javax.inject:1
log4j:log4j:1.2.17
net.java.dev.jna:jna:5.2.0
net.minidev:accessors-smart:1.2
net.minidev:json-smart:2.4.7
Expand Down Expand Up @@ -472,9 +472,10 @@ org.jruby.jcodings:jcodings:1.0.13
org.jruby.joni:joni:2.1.2
org.slf4j:jul-to-slf4j:jar:1.7.25
org.ojalgo:ojalgo:43.0:compile
org.slf4j:jul-to-slf4j:1.7.25
org.slf4j:slf4j-api:1.7.25
org.slf4j:slf4j-log4j12:1.7.25
org.slf4j:jcl-over-slf4j:1.7.35
org.slf4j:jul-to-slf4j:1.7.35
org.slf4j:slf4j-api:1.7.35
org.slf4j:slf4j-reload4j:1.7.35


CDDL 1.1 + GPLv2 with classpath exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<excludes>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
</excludes>
</dependencySet>
</dependencySets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<exclude>org.apache.hadoop:hadoop-hdfs</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
</excludes>
</dependencySet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<exclude>org.apache.hadoop:hadoop-hdfs</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
</excludes>
</dependencySet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<exclude>org.apache.hadoop:hadoop-hdfs</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
</excludes>
</dependencySet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<exclude>org.apache.hadoop:hadoop-hdfs</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
<exclude>jdiff:jdiff:jar</exclude>
</excludes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<exclude>org.apache.hadoop:hadoop-hdfs</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
</excludes>
</dependencySet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<exclude>org.apache.hadoop:hadoop-pipes</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
</excludes>
</dependencySet>
</dependencySets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
<exclude>org.apache.hadoop:*</exclude>
<!-- use slf4j from common to avoid multiple binding warnings -->
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-reload4j</exclude>
<exclude>org.hsqldb:hsqldb</exclude>
</excludes>
</dependencySet>
Expand Down
4 changes: 2 additions & 2 deletions hadoop-client-modules/hadoop-client-check-invariants/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
<exclude>org.slf4j:slf4j-api</exclude>
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
<exclude>commons-logging:commons-logging</exclude>
<!-- Leave log4j unshaded so downstream users can configure logging. -->
<exclude>log4j:log4j</exclude>
<!-- Leave reload4j unshaded so downstream users can configure logging. -->
<exclude>ch.qos.reload4j:reload4j</exclude>
<!-- Leave javax annotations we need exposed -->
<exclude>com.google.code.findbugs:jsr305</exclude>
<!-- Leave bouncycastle unshaded because it's signed with a special Oracle certificate so it can be a custom JCE security provider -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
<exclude>org.slf4j:slf4j-api</exclude>
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
<exclude>commons-logging:commons-logging</exclude>
<!-- Leave log4j unshaded so downstream users can configure logging. -->
<exclude>log4j:log4j</exclude>
<!-- Leave reload4j unshaded so downstream users can configure logging. -->
<exclude>ch.qos.reload4j:reload4j</exclude>
<!-- Leave JUnit unshaded so downstream can use our test helper classes -->
<exclude>junit:junit</exclude>
<!-- JUnit brings in hamcrest -->
Expand Down
9 changes: 2 additions & 7 deletions hadoop-client-modules/hadoop-client-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,15 @@

<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
10 changes: 7 additions & 3 deletions hadoop-client-modules/hadoop-client-minicluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -696,7 +700,7 @@
<exclude>commons-logging:commons-logging</exclude>
<exclude>junit:junit</exclude>
<exclude>com.google.code.findbugs:jsr305</exclude>
<exclude>log4j:log4j</exclude>
<exclude>ch.qos.reload4j:reload4j</exclude>
<exclude>org.eclipse.jetty.websocket:websocket-common</exclude>
<exclude>org.eclipse.jetty.websocket:websocket-api</exclude>
<!-- We need a filter that matches just those things that are included in the above artiacts -->
Expand Down
8 changes: 4 additions & 4 deletions hadoop-client-modules/hadoop-client-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
* one of the three custom log4j appenders we have
-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -150,8 +150,8 @@
<exclude>org.slf4j:slf4j-api</exclude>
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
<exclude>commons-logging:commons-logging</exclude>
<!-- Leave log4j unshaded so downstream users can configure logging. -->
<exclude>log4j:log4j</exclude>
<!-- Leave reload4j unshaded so downstream users can configure logging. -->
<exclude>ch.qos.reload4j:reload4j</exclude>
<!-- Leave javax APIs that are stable -->
<!-- the jdk ships part of the javax.annotation namespace, so if we want to relocate this we'll have to care it out by class :( -->
<exclude>com.google.code.findbugs:jsr305</exclude>
Expand Down
14 changes: 2 additions & 12 deletions hadoop-client-modules/hadoop-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@
<artifactId>commons-cli</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jersey</groupId>
Expand Down Expand Up @@ -294,11 +294,6 @@
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<!-- No slf4j backends for downstream clients -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -327,11 +322,6 @@
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<!-- No slf4j backends for downstream clients -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions hadoop-common-project/hadoop-auth-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
12 changes: 9 additions & 3 deletions hadoop-common-project/hadoop-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -185,6 +185,12 @@
<artifactId>apacheds-server-integ</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
Expand Down
6 changes: 3 additions & 3 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -238,7 +238,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static boolean isLog4jLogger(Class<?> clazz) {
}
Logger log = LoggerFactory.getLogger(clazz);
try {
Class log4jClass = Class.forName("org.slf4j.impl.Log4jLoggerAdapter");
Class log4jClass = Class.forName("org.slf4j.impl.Reload4jLoggerAdapter");
return log4jClass.isInstance(log);
} catch (ClassNotFoundException e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public void testFindContainingJar() {
Assert.assertTrue("Containing jar does not exist on file system ",
jarFile.exists());
Assert.assertTrue("Incorrect jar file " + containingJar,
jarFile.getName().matches("log4j.*[.]jar"));
jarFile.getName().matches("reload4j.*[.]jar"));
}
}
6 changes: 3 additions & 3 deletions hadoop-common-project/hadoop-kms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
<type>test-jar</type>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -145,7 +145,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion hadoop-common-project/hadoop-minikdc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions hadoop-common-project/hadoop-nfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdfs-project/hadoop-hdfs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
6 changes: 3 additions & 3 deletions hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
<type>test-jar</type>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -190,7 +190,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
<!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
Expand Down
Loading

0 comments on commit 77081e1

Please sign in to comment.