Skip to content

Commit 49369bd

Browse files
committed
HADOOP-18088. Replace log4j 1.x with reload4j.
1 parent 58fe5b2 commit 49369bd

File tree

29 files changed

+179
-81
lines changed

29 files changed

+179
-81
lines changed

hadoop-client-modules/hadoop-client-check-invariants/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
8888
<exclude>commons-logging:commons-logging</exclude>
8989
<!-- Leave log4j unshaded so downstream users can configure logging. -->
90-
<exclude>log4j:log4j</exclude>
90+
<exclude>ch.qos.reload4j:reload4j</exclude>
9191
<!-- Leave javax annotations we need exposed -->
9292
<exclude>com.google.code.findbugs:jsr305</exclude>
9393
<!-- Leave bouncycastle unshaded because it's signed with a special Oracle certificate so it can be a custom JCE security provider -->

hadoop-client-modules/hadoop-client-check-test-invariants/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
9292
<exclude>commons-logging:commons-logging</exclude>
9393
<!-- Leave log4j unshaded so downstream users can configure logging. -->
94-
<exclude>log4j:log4j</exclude>
94+
<exclude>ch.qos.reload4j:reload4j</exclude>
9595
<!-- Leave JUnit unshaded so downstream can use our test helper classes -->
9696
<exclude>junit:junit</exclude>
9797
<!-- JUnit brings in hamcrest -->

hadoop-client-modules/hadoop-client-integration-tests/pom.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,15 @@
3333

3434
<dependencies>
3535
<dependency>
36-
<groupId>log4j</groupId>
37-
<artifactId>log4j</artifactId>
36+
<groupId>ch.qos.reload4j</groupId>
37+
<artifactId>reload4j</artifactId>
3838
<scope>test</scope>
3939
</dependency>
4040
<dependency>
4141
<groupId>org.slf4j</groupId>
4242
<artifactId>slf4j-api</artifactId>
4343
<scope>test</scope>
4444
</dependency>
45-
<dependency>
46-
<groupId>org.slf4j</groupId>
47-
<artifactId>slf4j-log4j12</artifactId>
48-
<scope>test</scope>
49-
</dependency>
5045
<dependency>
5146
<groupId>junit</groupId>
5247
<artifactId>junit</artifactId>

hadoop-client-modules/hadoop-client-minicluster/pom.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@
187187
<artifactId>slf4j-log4j12</artifactId>
188188
</exclusion>
189189
<exclusion>
190-
<groupId>log4j</groupId>
191-
<artifactId>log4j</artifactId>
190+
<groupId>org.slf4j</groupId>
191+
<artifactId>slf4j-reload4j</artifactId>
192+
</exclusion>
193+
<exclusion>
194+
<groupId>ch.qos.reload4j</groupId>
195+
<artifactId>reload4j</artifactId>
192196
</exclusion>
193197
<exclusion>
194198
<groupId>com.fasterxml.jackson.core</groupId>
@@ -669,7 +673,7 @@
669673
<exclude>commons-logging:commons-logging</exclude>
670674
<exclude>junit:junit</exclude>
671675
<exclude>com.google.code.findbugs:jsr305</exclude>
672-
<exclude>log4j:log4j</exclude>
676+
<exclude>ch.qos.reload4j:reload4j</exclude>
673677
<!-- We need a filter that matches just those things that are included in the above artiacts -->
674678
<!-- Leave bouncycastle unshaded because it's signed with a special Oracle certificate so it can be a custom JCE security provider -->
675679
<exclude>org.bouncycastle:*</exclude>

hadoop-client-modules/hadoop-client-runtime/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
* one of the three custom log4j appenders we have
104104
-->
105105
<dependency>
106-
<groupId>log4j</groupId>
107-
<artifactId>log4j</artifactId>
106+
<groupId>ch.qos.reload4j</groupId>
107+
<artifactId>reload4j</artifactId>
108108
<scope>runtime</scope>
109109
<optional>true</optional>
110110
</dependency>
@@ -153,7 +153,7 @@
153153
<!-- Leave commons-logging unshaded so downstream users can configure logging. -->
154154
<exclude>commons-logging:commons-logging</exclude>
155155
<!-- Leave log4j unshaded so downstream users can configure logging. -->
156-
<exclude>log4j:log4j</exclude>
156+
<exclude>ch.qos.reload4j:reload4j</exclude>
157157
<!-- Leave javax APIs that are stable -->
158158
<!-- 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 :( -->
159159
<exclude>com.google.code.findbugs:jsr305</exclude>

hadoop-client-modules/hadoop-client/pom.xml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@
206206
<artifactId>commons-cli</artifactId>
207207
</exclusion>
208208
<exclusion>
209-
<groupId>log4j</groupId>
210-
<artifactId>log4j</artifactId>
209+
<groupId>ch.qos.reload4j</groupId>
210+
<artifactId>reload4j</artifactId>
211211
</exclusion>
212212
<exclusion>
213213
<groupId>com.sun.jersey</groupId>
@@ -282,11 +282,6 @@
282282
<groupId>io.netty</groupId>
283283
<artifactId>netty</artifactId>
284284
</exclusion>
285-
<!-- No slf4j backends for downstream clients -->
286-
<exclusion>
287-
<groupId>org.slf4j</groupId>
288-
<artifactId>slf4j-log4j12</artifactId>
289-
</exclusion>
290285
</exclusions>
291286
</dependency>
292287

@@ -315,11 +310,6 @@
315310
<groupId>io.netty</groupId>
316311
<artifactId>netty</artifactId>
317312
</exclusion>
318-
<!-- No slf4j backends for downstream clients -->
319-
<exclusion>
320-
<groupId>org.slf4j</groupId>
321-
<artifactId>slf4j-log4j12</artifactId>
322-
</exclusion>
323313
</exclusions>
324314
</dependency>
325315

hadoop-common-project/hadoop-auth-examples/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
<scope>compile</scope>
4848
</dependency>
4949
<dependency>
50-
<groupId>log4j</groupId>
51-
<artifactId>log4j</artifactId>
50+
<groupId>ch.qos.reload4j</groupId>
51+
<artifactId>reload4j</artifactId>
5252
<scope>runtime</scope>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.slf4j</groupId>
56-
<artifactId>slf4j-log4j12</artifactId>
56+
<artifactId>slf4j-reload4j</artifactId>
5757
<scope>runtime</scope>
5858
</dependency>
5959
</dependencies>

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@
8282
<scope>compile</scope>
8383
</dependency>
8484
<dependency>
85-
<groupId>log4j</groupId>
86-
<artifactId>log4j</artifactId>
85+
<groupId>ch.qos.reload4j</groupId>
86+
<artifactId>reload4j</artifactId>
8787
<scope>runtime</scope>
8888
</dependency>
8989
<dependency>
9090
<groupId>org.slf4j</groupId>
91-
<artifactId>slf4j-log4j12</artifactId>
91+
<artifactId>slf4j-reload4j</artifactId>
9292
<scope>runtime</scope>
9393
</dependency>
9494
<dependency>
@@ -176,6 +176,12 @@
176176
<artifactId>apacheds-server-integ</artifactId>
177177
<version>${apacheds.version}</version>
178178
<scope>test</scope>
179+
<exclusions>
180+
<exclusion>
181+
<groupId>log4j</groupId>
182+
<artifactId>log4j</artifactId>
183+
</exclusion>
184+
</exclusions>
179185
</dependency>
180186
<dependency>
181187
<groupId>org.apache.directory.server</groupId>

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@
151151
<scope>compile</scope>
152152
</dependency>
153153
<dependency>
154-
<groupId>log4j</groupId>
155-
<artifactId>log4j</artifactId>
154+
<groupId>ch.qos.reload4j</groupId>
155+
<artifactId>reload4j</artifactId>
156156
<scope>compile</scope>
157157
</dependency>
158158
<dependency>
@@ -192,7 +192,7 @@
192192
</dependency>
193193
<dependency>
194194
<groupId>org.slf4j</groupId>
195-
<artifactId>slf4j-log4j12</artifactId>
195+
<artifactId>slf4j-reload4j</artifactId>
196196
<scope>compile</scope>
197197
</dependency>
198198
<dependency>

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericsUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static boolean isLog4jLogger(Class<?> clazz) {
8585
}
8686
Logger log = LoggerFactory.getLogger(clazz);
8787
try {
88-
Class log4jClass = Class.forName("org.slf4j.impl.Log4jLoggerAdapter");
88+
Class log4jClass = Class.forName("org.slf4j.impl.Reload4jLoggerAdapter");
8989
return log4jClass.isInstance(log);
9090
} catch (ClassNotFoundException e) {
9191
return false;

0 commit comments

Comments
 (0)