[
https://issues.apache.org/jira/browse/LOG4J2-2252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371138#comment-16371138
]
ASF GitHub Bot commented on LOG4J2-2252:
----------------------------------------
Github user remkop commented on a diff in the pull request:
https://github.com/apache/logging-log4j2/pull/148#discussion_r169575464
--- Diff:
log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java
---
@@ -43,7 +43,7 @@ public String getFormattedMessage() {
@Override
public String getFormat() {
- return getFormattedMessage();
+ return charSequence instanceof String ? (String) charSequence :
null;
--- End diff --
This is wrong. If charSequence is a StringBuilder or CharBuffer, the method
would return null after the proposed change.
> Reusable events drop the original format string
> -----------------------------------------------
>
> Key: LOG4J2-2252
> URL: https://issues.apache.org/jira/browse/LOG4J2-2252
> Project: Log4j 2
> Issue Type: Bug
> Reporter: Carter Douglas Kozak
> Priority: Major
>
> MutableLogEvent and RingBufferLogEvent hold references to state from original
> messages, but they currently exclude the value of Message.getFormat().
> I would like to write a custom Layout implementation which is aware of the
> format string and parameters, which doesn't necessarily use the formatted
> message value.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)