LoggingSystemTests Class — spring-boot Architecture
Architecture documentation for the LoggingSystemTests class in LoggingSystemTests.java from the spring-boot codebase.
Entity Profile
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/logging/LoggingSystemTests.java lines 37–94
class LoggingSystemTests {
@AfterEach
void clearSystemProperty() {
System.clearProperty(LoggingSystem.SYSTEM_PROPERTY);
}
@Test
void logbackIsTheDefaultLoggingSystem() {
assertThat(LoggingSystem.get(getClass().getClassLoader())).isInstanceOf(LogbackLoggingSystem.class);
}
@Test
@ClassPathExclusions("logback-*.jar")
void log4j2IsUsedInTheAbsenceOfLogback() {
assertThat(LoggingSystem.get(getClass().getClassLoader())).isInstanceOf(Log4J2LoggingSystem.class);
}
@Test
@ClassPathExclusions({ "logback-*.jar", "log4j-*.jar" })
void julIsUsedInTheAbsenceOfLogbackAndLog4j2() {
assertThat(LoggingSystem.get(getClass().getClassLoader())).isInstanceOf(JavaLoggingSystem.class);
}
@Test
void loggingSystemCanBeDisabled() {
System.setProperty(LoggingSystem.SYSTEM_PROPERTY, LoggingSystem.NONE);
LoggingSystem loggingSystem = LoggingSystem.get(getClass().getClassLoader());
assertThat(loggingSystem).isInstanceOf(NoOpLoggingSystem.class);
}
@Test
void getLoggerConfigurationIsUnsupported() {
assertThatExceptionOfType(UnsupportedOperationException.class)
.isThrownBy(() -> new StubLoggingSystem().getLoggerConfiguration("test-logger-name"));
}
@Test
void listLoggerConfigurationsIsUnsupported() {
assertThatExceptionOfType(UnsupportedOperationException.class)
.isThrownBy(() -> new StubLoggingSystem().getLoggerConfigurations());
}
private static final class StubLoggingSystem extends LoggingSystem {
@Override
public void beforeInitialize() {
// Stub implementation
}
@Override
public void setLogLevel(@Nullable String loggerName, @Nullable LogLevel level) {
// Stub implementation
}
}
}
Domain
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free