-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Description
YAML 1.1 maps off
to false
. We deal with this in LoggingApplicationListener
by coercing false
back to LogLevel.OFF
:
Lines 363 to 369 in 35a178a
private LogLevel coerceLogLevel(String level) { | |
String trimmedLevel = level.trim(); | |
if ("false".equalsIgnoreCase(trimmedLevel)) { | |
return LogLevel.OFF; | |
} | |
return LogLevel.valueOf(trimmedLevel.toUpperCase(Locale.ENGLISH)); | |
} |
This allows users to configure logging using logging.level.example.my.package: off
in YAML.
We do no perform any coercion when turning the banner off so spring.main.banner-mode: off
will fail and spring.main.banner-mode: 'off'
has to be used instead.
I think we should consistently allow false
to be bound to an enum that would accept off
. Perhaps this is something that could be done in the binder rather than as a special case for banner mode.
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement