Merge branch '1.1.x'
This commit is contained in:
commit
538cd90657
|
@ -185,19 +185,20 @@ public class LoggingApplicationListener implements SmartApplicationListener {
|
|||
system.initialize(value);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
this.logger.warn("Logging environment value '" + value
|
||||
+ "' cannot be opened and will be ignored");
|
||||
this.logger
|
||||
.warn("Logging environment value '"
|
||||
+ value
|
||||
+ "' cannot be opened and will be ignored (using default location instead)");
|
||||
system.initialize();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
system.initialize();
|
||||
if (this.springBootLogging != null) {
|
||||
initializeLogLevel(system, this.springBootLogging);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this.springBootLogging != null) {
|
||||
initializeLogLevel(system, this.springBootLogging);
|
||||
}
|
||||
setLogLevels(system, environment);
|
||||
|
||||
}
|
||||
|
|
|
@ -126,6 +126,11 @@ public class LoggingApplicationListenerTests {
|
|||
this.initializer.initialize(this.context.getEnvironment(),
|
||||
this.context.getClassLoader());
|
||||
// Should not throw
|
||||
this.logger.info("Hello world");
|
||||
String output = this.outputCapture.toString().trim();
|
||||
assertTrue("Wrong output:\n" + output, output.contains("Hello world"));
|
||||
assertFalse("Wrong output:\n" + output, output.contains("???"));
|
||||
assertTrue(new File(tmpDir() + "/spring.log").exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue