You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Volkan Yazici (Jira)" <ji...@apache.org> on 2020/11/24 14:57:00 UTC

[jira] [Updated] (LOG4J2-2962) Make "key" optional and add "flatten" to JsonTemplateLayout "map" resolver

     [ https://issues.apache.org/jira/browse/LOG4J2-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Volkan Yazici updated LOG4J2-2962:
----------------------------------
    Fix Version/s: 2.15.0

> Make "key" optional and add "flatten" to JsonTemplateLayout "map" resolver
> --------------------------------------------------------------------------
>
>                 Key: LOG4J2-2962
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2962
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>    Affects Versions: 2.14.0
>            Reporter: Volkan Yazici
>            Priority: Minor
>              Labels: JsonTemplateLayout
>             Fix For: 2.15.0
>
>
> As [reported by Magnus Kvalheim in a log4j2-logstash-layout issue|https://github.com/vy/log4j2-logstash-layout/issues/68#issuecomment-726357901], there is a request as follows:
> bq. With the message resolver it's possible to set the {{fallbackKey}} - an item to wishlist would be to be able to do the opposite. That is option to disregard {{SimpleMessage}} (as it's already printed in the {{message}} field.) Another option could be to use the mapresolver without specifying key?
> If I understand the request right, making {{key}} directive optional (hence, one would be able to resolve the entire {{MapMessage}}) and adding a {{flatten}} directive (similar to the one in MDC resolver) can address this wish. That is,
> {code}
> config        = [ key ] , [ stringified ] , [ flatten ]
> key           = "key" -> string
> stringified   = "stringified" -> boolean
> flatten       = "flatten" -> ( boolean | flattenConfig )
> flattenConfig = [ flattenPrefix ]
> flattenPrefix = "prefix" -> string
> {code}



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