Fix SystemStatusListener to prevent superfluous output
Fix `SystemStatusListener` so that superfluous output is not printed when starting an application. This change ensures that the `SystemStatusListener` is not added twice, and that retrospective logging only occurs when `debug` is true. See gh-43931 Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
This commit is contained in:
committed by
Phillip Webb
parent
fc01b011d5
commit
6ba8e9b089
@@ -36,11 +36,12 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleStructuredLoggingApplicationTests {
|
||||
|
||||
@AfterEach
|
||||
void reset() {
|
||||
void reset(CapturedOutput output) {
|
||||
LoggingSystem.get(getClass().getClassLoader()).cleanUp();
|
||||
for (LoggingSystemProperty property : LoggingSystemProperty.values()) {
|
||||
System.getProperties().remove(property.getEnvironmentVariableName());
|
||||
}
|
||||
assertThat(output).doesNotContain("-INFO in ch.qos.logback.classic.LoggerContext");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user