robinmarechal opened a new pull request, #21321:
URL: https://github.com/apache/kafka/pull/21321
Some YAML parsers seems to parse `OFF` as `false`, which leads to failure in
log4j configuration loading:
```
2026-01-15T20:10:38.166033500Z main WARN Error while converting string
[false] to type [class org.apache.logging.log4j.Level]. Using default value
[null].
java.lang.IllegalArgumentException: Unknown level constant [FALSE].
at org.apache.logging.log4j.Level.valueOf(Level.java:348)
at
org.apache.logging.log4j.core.config.plugins.convert.TypeConverters$LevelConverter.convert(TypeConverters.java:301)
...
```
Simply using quotes around `OFF` prevents this issue.
The following YAML
```yaml
Loggers:
Root:
level: OFF # <-- Without ""
AppenderRef:
- ref: STDOUT
```
Is parsed to
```json
{
"Loggers" : {
"Root" : {
"level" : false, // <-- Instead of "OFF"
"AppenderRef" : [ {
"ref" : "STDOUT"
} ]
}
}
```
Mentioned in old YAML specs (https://yaml.org/type/bool.html).
An element matching this regex is treated as a boolean:
`y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF`
I did not found any mention anywhere that it is not the case anymore, and I
have the error in my applications.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]