|
|
@ -128,8 +128,8 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
|
|
|
assertThat(getLineWithText(file, "Hello world")).contains("INFO");
|
|
|
|
assertThat(getLineWithText(file, "Hello world")).contains("INFO");
|
|
|
|
assertThat(ReflectionTestUtils.getField(getRollingPolicy(), "maxFileSize")
|
|
|
|
assertThat(ReflectionTestUtils.getField(getRollingPolicy(), "maxFileSize")
|
|
|
|
.toString()).isEqualTo("10 MB");
|
|
|
|
.toString()).isEqualTo("10 MB");
|
|
|
|
assertThat(getRollingPolicy().getMaxHistory()).isEqualTo(
|
|
|
|
assertThat(getRollingPolicy().getMaxHistory())
|
|
|
|
CoreConstants.UNBOUND_HISTORY);
|
|
|
|
.isEqualTo(CoreConstants.UNBOUND_HISTORY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -350,8 +350,8 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
|
|
|
public void testMaxFileSizeProperty() throws Exception {
|
|
|
|
public void testMaxFileSizeProperty() throws Exception {
|
|
|
|
MockEnvironment environment = new MockEnvironment();
|
|
|
|
MockEnvironment environment = new MockEnvironment();
|
|
|
|
environment.setProperty("logging.file.max-size", "100MB");
|
|
|
|
environment.setProperty("logging.file.max-size", "100MB");
|
|
|
|
LoggingInitializationContext loggingInitializationContext =
|
|
|
|
LoggingInitializationContext loggingInitializationContext = new LoggingInitializationContext(
|
|
|
|
new LoggingInitializationContext(environment);
|
|
|
|
environment);
|
|
|
|
File file = new File(tmpDir(), "logback-test.log");
|
|
|
|
File file = new File(tmpDir(), "logback-test.log");
|
|
|
|
LogFile logFile = getLogFile(file.getPath(), null);
|
|
|
|
LogFile logFile = getLogFile(file.getPath(), null);
|
|
|
|
this.loggingSystem.initialize(loggingInitializationContext, null, logFile);
|
|
|
|
this.loggingSystem.initialize(loggingInitializationContext, null, logFile);
|
|
|
@ -365,8 +365,8 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
|
|
|
public void testMaxHistoryProperty() throws Exception {
|
|
|
|
public void testMaxHistoryProperty() throws Exception {
|
|
|
|
MockEnvironment environment = new MockEnvironment();
|
|
|
|
MockEnvironment environment = new MockEnvironment();
|
|
|
|
environment.setProperty("logging.file.max-history", "30");
|
|
|
|
environment.setProperty("logging.file.max-history", "30");
|
|
|
|
LoggingInitializationContext loggingInitializationContext =
|
|
|
|
LoggingInitializationContext loggingInitializationContext = new LoggingInitializationContext(
|
|
|
|
new LoggingInitializationContext(environment);
|
|
|
|
environment);
|
|
|
|
File file = new File(tmpDir(), "logback-test.log");
|
|
|
|
File file = new File(tmpDir(), "logback-test.log");
|
|
|
|
LogFile logFile = getLogFile(file.getPath(), null);
|
|
|
|
LogFile logFile = getLogFile(file.getPath(), null);
|
|
|
|
this.loggingSystem.initialize(loggingInitializationContext, null, logFile);
|
|
|
|
this.loggingSystem.initialize(loggingInitializationContext, null, logFile);
|
|
|
|