Michal Stefan created LOG4J2-2995:
-------------------------------------

             Summary: How to use eventTemplateAdditionalFields in log4j2.yaml
                 Key: LOG4J2-2995
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2995
             Project: Log4j 2
          Issue Type: Question
          Components: Appenders
    Affects Versions: 2.14.0
            Reporter: Michal Stefan


Hi,

I am struggling to find a way, how exactly to write the syntax in yaml to be 
able to use 

EventTemplateAdditionalFields in JsonTemplateLayout. You don't provide any 
example on your website and nothing I have tried works. My current config looks 
like this:


{code:java}
Configuration:

  Appenders:
    Console:
      name: LogToConsole
      target: SYSTEM_OUT
      JsonTemplateLayout:
        eventTemplateUri: classpath:LogstashJsonEventLayoutV1.json
        stackTraceEnabled: true
        maxStringLength: 32768
        EventTemplateAdditionalFields:
          EventTemplateAdditionalField:
            - key: service
              value: profiles-profile-service

  Loggers:
    Root:
      level: info
      AppenderRef:
        ref: LogToConsole
{code}

 
Could you please help? 

Best Regards,
Michal Stefan
 



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

Reply via email to