rgoers commented on code in PR #4410:
URL: https://github.com/apache/logging-log4j2/pull/4410#discussion_r4330232525


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/yaml/YamlConfigurationFactory.java:
##########
@@ -42,17 +54,33 @@ public class YamlConfigurationFactory extends 
ConfigurationFactory {
 
     private final boolean isActive;
 
+    private final boolean useJackson3;
+
     public YamlConfigurationFactory() {
-        for (final String dependency : dependencies) {
-            if (!Loader.isClassAvailable(dependency)) {
-                LOGGER.debug(
-                        "Missing dependencies for Yaml support, 
ConfigurationFactory {} is inactive",
-                        getClass().getName());
-                isActive = false;
-                return;
+        if (areClassesAvailable(JACKSON3_DEPENDENCIES)) {
+            LOGGER.debug("Using Jackson 3.x for Yaml support");
+            useJackson3 = true;
+            isActive = true;
+        } else if (areClassesAvailable(JACKSON2_DEPENDENCIES)) {
+            LOGGER.debug("Using Jackson 2.x for Yaml support");
+            useJackson3 = false;
+            isActive = true;

Review Comment:
   This is a lose/lose scenario. If I add Jackson 3 to a build I am almost 
certainly upgrading and only leaving Jackson 2 for some third party library I 
cannot change. Because of that it makes more sense to me to have Jackson 3 be 
the default if it is present.



-- 
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]

Reply via email to