You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2017/01/22 09:19:26 UTC

[jira] [Commented] (LOG4J2-1796) Serialize the ParameterizedMessage variables

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

Remko Popma commented on LOG4J2-1796:
-------------------------------------

There seems to be a misunderstanding:

When a ParameterizedMessage is serialized, the message String is formatted first, _including the parameter values_.  So the formatted string will contain the text value of the original parameters when deserialized. {{ParameterizedMessage::getFormattedMessage}} works correctly even for a serialized and deserialized Message. 

However the current implementation does not try to serialize the parameter Objects. 
Do you need the parameter Objects to be serialized and deserialized? (These objects will not be used to create the formatted message since that is done prior to serialization.) 

> Serialize the ParameterizedMessage variables
> --------------------------------------------
>
>                 Key: LOG4J2-1796
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1796
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Alexandru Ionita
>
> When serializing a {{LogEvent}}, if the message that the {{LogEvent}} consists of is of type {{ParameterizedMessage}}, the variables that are needed to construct the final String message are not serialized, thus making the message and the serialization itself unuseful, since the message is carrying the whole value of the {{LogEvent}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org