Configure Log4j2 classpath overrides consistently

Closes gh-32537
This commit is contained in:
Andy Wilkinson
2022-09-29 11:25:21 +01:00
parent be48f37a83
commit 84a25c7dcf
5 changed files with 68 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ import org.springframework.boot.logging.LoggingInitializationContext;
import org.springframework.boot.logging.LoggingSystem;
import org.springframework.boot.logging.LoggingSystemProperties;
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
import org.springframework.boot.testsupport.classpath.ClassPathOverrides;
import org.springframework.boot.testsupport.logging.ConfigureClasspathToPreferLog4j2;
import org.springframework.boot.testsupport.system.CapturedOutput;
import org.springframework.boot.testsupport.system.OutputCaptureExtension;
import org.springframework.mock.env.MockEnvironment;
@@ -76,7 +76,7 @@ import static org.mockito.Mockito.times;
*/
@ExtendWith(OutputCaptureExtension.class)
@ClassPathExclusions("logback-*.jar")
@ClassPathOverrides("org.apache.logging.log4j:log4j-slf4j-impl:2.17.2")
@ConfigureClasspathToPreferLog4j2
class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
private final TestLog4J2LoggingSystem loggingSystem = new TestLog4J2LoggingSystem();