From 281f4d4ceb395e9e352c65e41edb44f5c71745d8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 1 Apr 2020 11:10:16 +0100 Subject: [PATCH] Clear system property set by log file registration Closes gh-20790 --- .../logging/LoggingApplicationListenerIntegrationTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java index 4f7e5eb3413..24cb44f5df5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java @@ -30,6 +30,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.event.ApplicationStartingEvent; import org.springframework.boot.logging.LogFile; import org.springframework.boot.logging.LoggingSystem; +import org.springframework.boot.logging.LoggingSystemProperties; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; import org.springframework.context.ApplicationListener; @@ -64,6 +65,9 @@ class LoggingApplicationListenerIntegrationTests { assertThat(service.logFile).isNotNull(); assertThat(service.logFile.toString()).isEqualTo(logFile); } + finally { + System.clearProperty(LoggingSystemProperties.LOG_FILE); + } } @Test