[ 
https://issues.apache.org/jira/browse/LOG4J2-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17242475#comment-17242475
 ] 

ASF subversion and git services commented on LOG4J2-2966:
---------------------------------------------------------

Commit ab8753f631b56eb2ad958041c34b32467cdbb198 in logging-log4j2's branch 
refs/heads/master from Volkan Yazıcı
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=ab8753f ]

LOG4J2-2966 Revert the usage of ParameterizedMessage.deepToString().

There are a couple of motivations for me to revert this change, but
some particular highlights are as follows:

- Many of the type check that is performed by deepToString() is
  already addressed in JsonWriter.

- Usage of an external method breaks the self-containment contract of
  JsonWriter.

- deepToString() protects against recursive collections, whereas
  JsonWriter doesn't. Even using deepToString() in JsonWriter
  isn't enough to protect it against self-referencing collections;
  all collection handling methods in JsonWriter needs to be adapted.
  Hence, rather than a code base where there is partial mitigation for
  this anomaly, now it is explicit that there is no built-in prevention
  mechanisms. This behaviour is also in line with the Java standard
  library, e.g., Arrays.toString().


> Investigate replacing String.valueOf() usages in JTL with 
> ParameterizedMessage.deepToString()
> ---------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2966
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2966
>             Project: Log4j 2
>          Issue Type: Improvement
>            Reporter: Carter Kozak
>            Assignee: Volkan Yazici
>            Priority: Major
>              Labels: JsonTemplateLayout
>             Fix For: 3.0.0, 2.14.1
>
>
> As shared by [~ckozak] in [a GitHub pull request 
> conversation|https://github.com/apache/logging-log4j2/pull/441#discussion_r527706889]:
> {quote}... we might want to use something like 
> `ParameterizedMessage.deepToString(value)` for better handling of standard 
> types, and exception handling in the case `toString` throws.{quote}
> This story aims to investigate the possibility of replacing 
> {{String.valueOf()}} usages in JTL with 
> {{ParameterizedMessage.deepToString()}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to