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 "Mikael Ståldal (JIRA)" <ji...@apache.org> on 2015/10/15 17:36:05 UTC

[jira] [Comment Edited] (LOG4J2-1161) Builder like pattern to add values to MapMessage

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

Mikael Ståldal edited comment on LOG4J2-1161 at 10/15/15 3:35 PM:
------------------------------------------------------------------

Patch in Git branch LOG4J2-1161 please review


was (Author: mikaelstaldal):
Patch in Git branch LOG4J2-1161

> Builder like pattern to add values to MapMessage
> ------------------------------------------------
>
>                 Key: LOG4J2-1161
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1161
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: 2.4.1
>            Reporter: Mikael Ståldal
>            Priority: Minor
>
> It would be nice to have a builder like pattern to add values to {{MapMessage}} and its subclass {{StructuredDataMessage}}, so you can do 
> {code}
>         EventLogger.logEvent(
>             new StructuredDataMessage(confirm, null, "transfer")
>                 .withValue("toAccount", toAccount)
>                 .withValue("fromAccount", fromAccount)
>                 .withValue("amount", amount)
>         );
> {code}
> instead of
> {code}
>         StructuredDataMessage msg = new StructuredDataMessage(confirm, null, "transfer");
>         msg.put("toAccount", toAccount);
>         msg.put("fromAccount", fromAccount);
>         msg.put("amount", amount);
>         EventLogger.logEvent(msg);
> {code}



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