diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/SpringApplicationRunner.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/SpringApplicationRunner.java index 909ab69f707..e80fe39b5fd 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/SpringApplicationRunner.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/SpringApplicationRunner.java @@ -67,8 +67,17 @@ public class SpringApplicationRunner { this.sources = sources.clone(); this.args = args.clone(); this.compiler = new GroovyCompiler(configuration); - if (configuration.getLogLevel().intValue() <= Level.FINE.intValue()) { + int level = configuration.getLogLevel().intValue(); + if (level <= Level.FINER.intValue()) { System.setProperty("groovy.grape.report.downloads", "true"); + System.setProperty("trace", "true"); + } + else if (level <= Level.FINE.intValue()) { + System.setProperty("debug", "true"); + } + else if (level == Level.OFF.intValue()) { + System.setProperty("spring.main.showBanner", "false"); + System.setProperty("logging.level.ROOT", "OFF"); } } diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java index b2c84c93453..0c1232dd16d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java @@ -206,13 +206,17 @@ public class LoggingApplicationListener implements SmartApplicationListener { Map levels = new RelaxedPropertyResolver(environment) .getSubProperties("logging.level."); for (Entry entry : levels.entrySet()) { + String name = entry.getKey(); try { LogLevel level = LogLevel.valueOf(entry.getValue().toString()); - system.setLogLevel(entry.getKey(), level); + if (name.equalsIgnoreCase("root")) { + name = null; + } + system.setLogLevel(name, level); } catch (RuntimeException e) { this.logger.error("Cannot set level: " + entry.getValue() + " for '" - + entry.getKey() + "'"); + + name + "'"); } } }