mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-26 11:39:14 +00:00
Polish "Avoid removing application-managed JUL bridge handler"
See gh-50779
This commit is contained in:
+10
@@ -407,6 +407,16 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
|
||||
assertThat(logger.getLevel()).isEqualTo(Level.FINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void cleanUpCleansBridgeHandlerInstalledByTheLoggingSystem() {
|
||||
this.loggingSystem.beforeInitialize();
|
||||
java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger("");
|
||||
assertThat(rootLogger.getHandlers()).hasAtLeastOneElementOfType(Log4jBridgeHandler.class);
|
||||
this.loggingSystem.cleanUp();
|
||||
java.util.logging.Logger rootLoggerAfterCleanUp = java.util.logging.Logger.getLogger("");
|
||||
assertThat(rootLoggerAfterCleanUp.getHandlers()).doesNotHaveAnyElementsOfTypes(Log4jBridgeHandler.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void cleanUpLeavesBridgeHandlerInstalledByTheApplicationInPlace() {
|
||||
java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
Reference in New Issue
Block a user