|
|
|
@ -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) {
|
|
|
|
|