use of org.springframework.boot.logging.LoggingInitializationContext in project spring-boot by spring-projects.
the class LogbackLoggingSystemTests method testLevelPatternProperty.
@Test
public void testLevelPatternProperty() {
MockEnvironment environment = new MockEnvironment();
environment.setProperty("logging.pattern.level", "X%clr(%p)X");
LoggingInitializationContext loggingInitializationContext = new LoggingInitializationContext(environment);
this.loggingSystem.initialize(loggingInitializationContext, null, null);
this.logger.info("Hello world");
String output = this.output.toString().trim();
assertThat(getLineWithText(output, "Hello world")).contains("XINFOX");
}
Aggregations