Reset StatusLogger fallback listener stream on initialization

Update `Log4J2LoggingSystem` so that the `StatusLogger` fallback
listener has its print stream reset on each initialization. This
allows output capture to work with the status listener.

Fixes gh-43578

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
This commit is contained in:
Dmytro Nosan
2024-12-19 17:25:10 +02:00
committed by Phillip Webb
parent ec75474abf
commit b6b9237f2c
5 changed files with 62 additions and 4 deletions

View File

@@ -35,8 +35,8 @@ import org.springframework.boot.testsupport.classpath.ClassPathOverrides;
@Target(ElementType.TYPE)
@Documented
@ClassPathExclusions("log4j-to-slf4j-*.jar")
@ClassPathOverrides({ "org.apache.logging.log4j:log4j-core:2.19.0",
"org.apache.logging.log4j:log4j-slf4j-impl:2.19.0" })
@ClassPathOverrides({ "org.apache.logging.log4j:log4j-core:2.24.3",
"org.apache.logging.log4j:log4j-slf4j-impl:2.24.3" })
public @interface ConfigureClasspathToPreferLog4j2 {
}