ppkarwasz commented on code in PR #1985:
URL: https://github.com/apache/logging-log4j2/pull/1985#discussion_r1402162868


##########
log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayout.java:
##########
@@ -249,6 +250,11 @@ public Map<String, String> getContentFormat() {
         return CONTENT_FORMAT;
     }
 
+    public static JsonTemplateLayout createDefaultLayout() {
+        final DefaultConfiguration configuration = new DefaultConfiguration();
+        return 
JsonTemplateLayout.newBuilder().setConfiguration(configuration).build();
+    }

Review Comment:
   Ok, so the configuration can not be `null`.
   
   However if I am not mistaken, the current callers of 
`JsonTemplateLayout#createDefaultLayout` are tests. Could you move the `new 
DefaultConfiguration()` into the code of the callers and pass it to this method 
via a parameter.
   
   Cf. #756 for a similar problem in `PatternLayout`.



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