Github user zslayton commented on a diff in the pull request:

    https://github.com/apache/logging-log4j2/pull/131#discussion_r150963138
  
    --- Diff: 
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
 ---
    @@ -295,7 +301,7 @@ public Message memento() {
                 return message;
             }
             final Object[] params = parameters == null ? new Object[0] : 
Arrays.copyOf(parameters, parameterCount);
    -        return new ParameterizedMessage(messageText.toString(), params);
    +        return new ParameterizedMessage(getFormat(), params);
    --- End diff --
    
    The original version of this code appears to cause nested pattern 
interpretation. For example, if you created a message with the pattern `"{}"` 
and the first parameter was `"json: [{}]"`, calling `memento()` on this event 
would cause the fully formatted message (`json: [{}]`) to be treated as the 
format for the `ParameterizedMessage` being constructed here. Because it 
contains braces, the message would attempt to pull from the parameter list to 
format it.


---

Reply via email to