Merge branch '1.1.x'

pull/1688/head
Dave Syer 10 years ago
commit 9ba7a1860f

@ -224,7 +224,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
for (Entry<String, Object> entry : levels.entrySet()) {
String name = entry.getKey();
try {
LogLevel level = LogLevel.valueOf(entry.getValue().toString());
LogLevel level = LogLevel.valueOf(environment.resolvePlaceholders(entry.getValue().toString()));
if (name.equalsIgnoreCase("root")) {
name = null;
}

@ -204,6 +204,18 @@ public class LoggingApplicationListenerTests {
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
public void parseLevelsFails() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context,

Loading…
Cancel
Save