rgoers opened a new pull request, #4410: URL: https://github.com/apache/logging-log4j2/pull/4410
YamlConfigurationFactory now supports Jackson 3.x through a new configuration class, Jackson3YamlConfiguration. When the Jackson 3 classes are on the classpath it uses them; otherwise it falls back to the existing Jackson 2.x YamlConfiguration. The code compiles with JDK 17. I ran all 7 YAML files from log4j-core-test through both versions and they produce the same appenders, loggers and log output, apart from one difference described below. I didn’t add any unit tests, and nothing is committed. **What changed** - New class: Jackson3YamlConfiguration.java. It can’t extend JsonConfiguration because Jackson 3 uses different node classes, so it’s a standalone class with the same node-walking logic, updated for Jackson 3’s renamed methods. It doesn’t turn on any comment setting, because YAML supports comments on its own. - YamlConfigurationFactory.java: checks for Jackson 3 first, then Jackson 2, and logs at debug level which one it picked. **Things to Know** - One parsing difference, and it’s an improvement: Jackson 3 reads YAML 1.2, where status: OFF stays the string OFF. Jackson 2 reads YAML 1.1 and turns it into boolean false, then logs “Invalid status level: false”. Values like on, off, yes and no will now come through as strings. - Java version: Jackson 3 needs Java 17 or later. That’s safe here because the Jackson 3 classes are only loaded when they’re on the classpath. - Choice when both are present: if an app has both Jackson 2 and 3, it now gets the Jackson 3 version. -- 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]
