Skip to content

Commit e44bfbe

Browse files
committed
Merge branch '1.5.x'
2 parents 7b39cdd + c4923d6 commit e44bfbe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ public void addLogFileProperty() {
215215
this.initializer.initialize(this.context.getEnvironment(),
216216
this.context.getClassLoader());
217217
Log logger = LogFactory.getLog(LoggingApplicationListenerTests.class);
218+
String existingOutput = this.outputCapture.toString();
218219
logger.info("Hello world");
219-
String output = this.outputCapture.toString().trim();
220+
String output = this.outputCapture.toString().substring(existingOutput.length())
221+
.trim();
220222
assertThat(output).startsWith("target/foo.log");
221223
}
222224

@@ -240,8 +242,10 @@ public void addLogPathProperty() {
240242
this.initializer.initialize(this.context.getEnvironment(),
241243
this.context.getClassLoader());
242244
Log logger = LogFactory.getLog(LoggingApplicationListenerTests.class);
245+
String existingOutput = this.outputCapture.toString();
243246
logger.info("Hello world");
244-
String output = this.outputCapture.toString().trim();
247+
String output = this.outputCapture.toString().substring(existingOutput.length())
248+
.trim();
245249
assertThat(output).startsWith("target/foo/spring.log");
246250
}
247251

0 commit comments

Comments
 (0)