Upgrade to Log4j2 2.20.0

Closes gh-34349
pull/34365/head
Andy Wilkinson 2 years ago
parent a6bca29d9e
commit 2c0c89454c

@ -776,7 +776,7 @@ bom {
]
}
}
library("Log4j2", "2.19.0") {
library("Log4j2", "2.20.0") {
group("org.apache.logging.log4j") {
imports = [
"log4j-bom"

@ -402,8 +402,7 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
loggerContext.getConfiguration()
.addLogger("com.example.test",
loggerContext.getConfiguration().addLogger("com.example.test",
new LoggerConfig("com.example.test", org.apache.logging.log4j.Level.INFO, false));
this.loggingSystem.setLogLevel("com.example", LogLevel.WARN);
this.loggingSystem.setLogLevel("com.example.test", LogLevel.DEBUG);
@ -427,6 +426,7 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
this.loggingSystem.initialize(this.initializationContext, null, null);
java.util.logging.Logger logger = java.util.logging.Logger.getLogger(Log4J2LoggingSystemTests.class.getName());
logger.info("Log to trigger level propagation");
assertThat(logger.getLevel()).isNull();
this.loggingSystem.setLogLevel(Log4J2LoggingSystemTests.class.getName(), LogLevel.DEBUG);
assertThat(logger.getLevel()).isEqualTo(Level.FINE);
@ -477,9 +477,7 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
assertThatIllegalStateException()
.isThrownBy(() -> this.loggingSystem.initialize(this.initializationContext,
"http://localhost:8080/shouldnotwork", null))
.havingCause()
.isInstanceOf(ProtocolException.class)
.withMessageContaining("http has not been enabled");
.havingCause().isInstanceOf(ProtocolException.class).withMessageContaining("http has not been enabled");
}
private String getRelativeClasspathLocation(String fileName) {

Loading…
Cancel
Save