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

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

Commit 37d865a03eb538f43021b2fd1f190e58d8ad8012 in logging-log4j2's branch 
refs/heads/master from Volkan Yazici
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=37d865a ]

LOG4J2-3074 Add replacement parameter to ReadOnlyStringMapResolver.


> Add replacement parameter to mdc resolver
> -----------------------------------------
>
>                 Key: LOG4J2-3074
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3074
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: JsonTemplateLayout
>    Affects Versions: 2.14.1
>            Reporter: Paul Rubin
>            Priority: Minor
>             Fix For: 2.15.0
>
>
> This story aims to add a {{replacement}} parameter to 
> {{ReadOnlyStringMapResolver}} (which is used by {{ThreadContextDataResolver}} 
> and {{MapResolver}}) for modifying the keys of the map before resolving them. 
> That is, given the following JSON template
> {code:json}
> {
>   "user": {
>     "$resolver": "mdc",
>     "pattern": "user:(.*)",
>     "replacement": "$1"
>   }
> }
> {code}
> A {{LogEvent}} with an MDC map composed of {{user:name}}, {{user:role}}, 
> {{sessionId}} entries will generate the following JSON:
> {code:json}
> {
>   "user": {
>     "name": "Paul Rubin",
>     "role": "ADMIN"
>   }
> }
> {code}



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

Reply via email to