Skip to content

Commit

Permalink
Remove Log4j v1 support completely, even with log4j-1.2-api bridge
Browse files Browse the repository at this point in the history
See #11925 for background.
  • Loading branch information
vorburger committed Dec 15, 2021
1 parent c83027c commit 776c5ba
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 715 deletions.
5 changes: 0 additions & 5 deletions common/pom.xml
Expand Up @@ -63,11 +63,6 @@
<artifactId>commons-logging</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
Expand Up @@ -49,11 +49,6 @@ private static InternalLoggerFactory newDefaultFactory(String name) {
return f;
}

f = useLog4JLoggerFactory(name);
if (f != null) {
return f;
}

return useJdkLoggerFactory(name);
}

Expand Down Expand Up @@ -83,19 +78,6 @@ private static InternalLoggerFactory useLog4J2LoggerFactory(String name) {
}
}

private static InternalLoggerFactory useLog4JLoggerFactory(String name) {
try {
InternalLoggerFactory f = Log4JLoggerFactory.INSTANCE;
f.newInstance(name).debug("Using Log4J as the default logging framework");
return f;
} catch (LinkageError ignore) {
return null;
} catch (Exception ignore) {
// We catch Exception and not ReflectiveOperationException as we still support java 6
return null;
}
}

private static InternalLoggerFactory useJdkLoggerFactory(String name) {
InternalLoggerFactory f = JdkLoggerFactory.INSTANCE;
f.newInstance(name).debug("Using java.util.logging as the default logging framework");
Expand Down

0 comments on commit 776c5ba

Please sign in to comment.