Commit 01c270d5 authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '2.3.x'

Closes gh-22011
parents cd47bece ce907b12
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -139,6 +139,7 @@ class DefaultLogbackConfiguration {
private void setRollingPolicy(RollingFileAppender<ILoggingEvent> appender, LogbackConfigurator config,
String logFile) {
SizeAndTimeBasedRollingPolicy<ILoggingEvent> rollingPolicy = new SizeAndTimeBasedRollingPolicy<>();
rollingPolicy.setContext(config.getContext());
rollingPolicy.setCleanHistoryOnStart(
this.patterns.getProperty("logging.file.clean-history-on-start", Boolean.class, false));
rollingPolicy.setFileNamePattern(
......
......@@ -111,6 +111,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
this.loggingSystem.initialize(this.initializationContext, null, getLogFile(null, tmpDir()));
this.logger.info("Hello world");
File file = new File(tmpDir() + "/spring.log");
assertThat(output).doesNotContain("LOGBACK:");
assertThat(output).contains("Hello world").doesNotContain("Hidden");
assertThat(getLineWithText(output, "Hello world")).contains("INFO");
assertThat(file.exists()).isTrue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment