diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java index cb180b2d357f..34c3cc2a8439 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java @@ -361,7 +361,7 @@ private void setLogLevel(LoggingSystem system, String[] names, String level) { private void setLogLevel(LoggingSystem system, String name, String level) { try { name = name.equalsIgnoreCase(LoggingSystem.ROOT_LOGGER_NAME) ? null : name; - system.setLogLevel(name, coerceLogLevel(level)); + system.setLogLevel(name, coerceLogLevel(level.trim())); } catch (RuntimeException ex) { this.logger.error("Cannot set level: " + level + " for '" + name + "'");