Commit 538cd906 authored by Dave Syer's avatar Dave Syer

Merge branch '1.1.x'

parents ff870de0 c2444aec
...@@ -185,19 +185,20 @@ public class LoggingApplicationListener implements SmartApplicationListener { ...@@ -185,19 +185,20 @@ public class LoggingApplicationListener implements SmartApplicationListener {
system.initialize(value); system.initialize(value);
} }
catch (Exception ex) { catch (Exception ex) {
this.logger.warn("Logging environment value '" + value this.logger
+ "' cannot be opened and will be ignored"); .warn("Logging environment value '"
+ value
+ "' cannot be opened and will be ignored (using default location instead)");
system.initialize();
} }
} }
else { else {
system.initialize(); system.initialize();
if (this.springBootLogging != null) {
initializeLogLevel(system, this.springBootLogging);
} }
if (this.springBootLogging != null) {
initializeLogLevel(system, this.springBootLogging);
} }
setLogLevels(system, environment); setLogLevels(system, environment);
} }
......
...@@ -126,6 +126,11 @@ public class LoggingApplicationListenerTests { ...@@ -126,6 +126,11 @@ public class LoggingApplicationListenerTests {
this.initializer.initialize(this.context.getEnvironment(), this.initializer.initialize(this.context.getEnvironment(),
this.context.getClassLoader()); this.context.getClassLoader());
// Should not throw // 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 @Test
......
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