Skip to content

Commit

Permalink
Merge branch '2.2.x' into 2.3.x
Browse files Browse the repository at this point in the history
Closes gh-22010
  • Loading branch information
wilkinsona committed Jun 18, 2020
2 parents 8a7c32f + 1b62aba commit ce907b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
@@ -1,5 +1,5 @@
/*
* 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.
Expand Down Expand Up @@ -139,6 +139,7 @@ private Appender<ILoggingEvent> fileAppender(LogbackConfigurator config, String
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(
Expand Down
Expand Up @@ -111,6 +111,7 @@ void withFile(CapturedOutput output) {
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();
Expand Down

0 comments on commit ce907b1

Please sign in to comment.