Commit 9ba7a186 authored by Dave Syer's avatar Dave Syer

Merge branch '1.1.x'

parents 4cf9e045 3b2fb305
...@@ -224,7 +224,7 @@ public class LoggingApplicationListener implements SmartApplicationListener { ...@@ -224,7 +224,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
for (Entry<String, Object> entry : levels.entrySet()) { for (Entry<String, Object> entry : levels.entrySet()) {
String name = entry.getKey(); String name = entry.getKey();
try { try {
LogLevel level = LogLevel.valueOf(entry.getValue().toString()); LogLevel level = LogLevel.valueOf(environment.resolvePlaceholders(entry.getValue().toString()));
if (name.equalsIgnoreCase("root")) { if (name.equalsIgnoreCase("root")) {
name = null; name = null;
} }
......
...@@ -204,6 +204,18 @@ public class LoggingApplicationListenerTests { ...@@ -204,6 +204,18 @@ public class LoggingApplicationListenerTests {
assertThat(this.outputCapture.toString(), containsString("testattrace")); assertThat(this.outputCapture.toString(), containsString("testattrace"));
} }
@Test
public void parseLevelsWithPlaceholder() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "foo=TRACE",
"logging.level.org.springframework.boot=${foo}");
this.initializer.initialize(this.context.getEnvironment(),
this.context.getClassLoader());
this.logger.debug("testatdebug");
this.logger.trace("testattrace");
assertThat(this.outputCapture.toString(), containsString("testatdebug"));
assertThat(this.outputCapture.toString(), containsString("testattrace"));
}
@Test @Test
public void parseLevelsFails() throws Exception { public void parseLevelsFails() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
......
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