carterkozak commented on a change in pull request #444:
URL: https://github.com/apache/logging-log4j2/pull/444#discussion_r532232183



##########
File path: 
log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/ReadOnlyStringMapResolver.java
##########
@@ -202,9 +202,7 @@ public void resolve(final LogEvent logEvent, final 
JsonWriter jsonWriter) {
                 final ReadOnlyStringMap map = mapAccessor.apply(logEvent);
                 final Object value = map == null ? null : map.getValue(key);
                 if (stringified) {
-                    final String valueString =
-                            ParameterizedMessage.deepToString(value);
-                    jsonWriter.writeString(valueString);

Review comment:
       When we moved from `Objects.toString(value)` -> 
`ParameterizedMessage.deepToString(value)` we also changed null handling, where 
null values previously resulted in the string `"null"` but 
`ParameterizedMessage.deepToString(` produces a null string in that case, so we 
would write a json null token.
   
   writeAsString will write the value as `"null"` once again. I should add test 
coverage separately.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to