File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2 Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 6767import org .springframework .boot .logging .LoggingSystem ;
6868import org .springframework .boot .logging .LoggingSystemProperties ;
6969import org .springframework .boot .logging .LoggingSystemProperty ;
70+ import org .springframework .boot .logging .log4j2 .Log4j2RollingPolicySystemProperty ;
7071import org .springframework .boot .testsupport .classpath .ClassPathExclusions ;
7172import org .springframework .boot .testsupport .classpath .resources .WithResource ;
7273import org .springframework .boot .testsupport .logging .ConfigureClasspathToPreferLog4j2 ;
@@ -123,6 +124,7 @@ void cleanUp() {
123124 this .loggingSystem .getConfiguration ().stop ();
124125 this .loggingSystem .cleanUp ();
125126 PluginRegistry .getInstance ().clear ();
127+ clearRollingPolicySystemProperties ();
126128 }
127129
128130 @ Test
@@ -137,6 +139,12 @@ void noFile(CapturedOutput output) {
137139 assertThat (configuration .getConfigurationSource ().getFile ()).isNotNull ();
138140 }
139141
142+ private void clearRollingPolicySystemProperties () {
143+ for (Log4j2RollingPolicySystemProperty property : Log4j2RollingPolicySystemProperty .values ()) {
144+ System .clearProperty (property .getEnvironmentVariableName ());
145+ }
146+ }
147+
140148 @ Test
141149 void withFile (CapturedOutput output ) {
142150 this .loggingSystem .beforeInitialize ();
You can’t perform that action at this time.
0 commit comments