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

Volkan Yazici commented on LOG4J2-3013:
---------------------------------------

Hello [~expert]! The usage of JSON Template Layout 
{{eventTemplateAdditionalFields}} is [already 
documented|https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#additional-event-template-fields],
 though, it is broken in 2.14.0 release. We have fixed the issue (*and* changed 
the semantics!) in LOG4J2-2961 and LOG4J2-2973, which is bound for 2.14.1 
release.

This said, you can still use JSON Template Layout in 2.14.0 with your 
additional fields by simply putting the entire template including your custom 
fields into {{eventTemplate}} configuration parameter.

Since this ticket is a duplicate of LOG4J2-2961, I am closing it. Feel free to 
open it if you have any further concerns.

> Impossible to specify AdditionalField of JsonLayout in json config
> ------------------------------------------------------------------
>
>                 Key: LOG4J2-3013
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3013
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators, JsonTemplateLayout
>    Affects Versions: 2.14.0
>         Environment: log4j2 2.14.0 on Oracle JDK 14
>            Reporter: expert
>            Priority: Major
>
> Applogozies I have to resort to creating an issue but I think it's major 
> problem for users who want to use new json config.
> Could you please demostrate how to specify AdditionalField of JsonLayout in 
> json config ?
> Ideally it would be good to see in documentation example of configuration for 
> every type of plugin annotation (PluginBuilderAttribute, PluginElement and 
> etc.)
> Unfortunatelly I couldnt'n figure out how to set additionalFields after two 
> hours of heavy debugging in log4j2 sources.



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

Reply via email to