To be more precise, I only need the name of the exception in a dedicated field like the thrown_name in the JSON layout.
Greetings, Christian On 14.08.18, 08:36, "Fröstl, Christian" <christian.froe...@accenture.com> wrote: We like to have a local log format and don't like to send all logs directly to the server. Do you have any idea to get this format in a patternlayout? Thanks and greetings, Christian On 13.08.18, 20:53, "Matt Sicker" <boa...@gmail.com> wrote: Have you tried out the GELF layout? On Mon, 13 Aug 2018 at 11:09, Fröstl, Christian < christian.froe...@accenture.com> wrote: > Hi everybody, > > we are using the log4j2 json appender to generate json logs which will be > used in graylog. > The JSON layout doesn’t fit perfectly for us, and I tried to create our > own JSON by using the RollingRandomAccessFile appender with the > patternLayout and the JSON encoding function. > This fits very good for us, but I am not able to create a field > thrown_name, like in the JSON appender. > > Example of JSON Appender: > Field name: thrown_extendedStackTrace > Value: org.springframework.beans.FatalBeanException; ......... <the whole > stacktrace> > > Field name: thrown_name > Value: org.springframework.beans.FatalBeanException > > It is no problem to generate the whole stacktrace in patternlayout using > this code snippet: enc{%throwable}{JSON} > But how to generate a field which only includes the thrown_name of the > exception? > > Thanks and greetings, > Christian > > > > ________________________________ > > This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise confidential information. If you have > received it in error, please notify the sender immediately and delete the > original. Any other use of the e-mail by you is prohibited. Where allowed > by local law, electronic communications with Accenture and its affiliates, > including e-mail and instant messaging (including content), may be scanned > by our systems for the purposes of information security and assessment of > internal compliance with Accenture policy. Your privacy is important to us. > Accenture uses your personal data only in compliance with data protection > laws. For further information on how Accenture processes your personal > data, please see our privacy statement at > https://www.accenture.com/us-en/privacy-policy. > > ______________________________________________________________________________________ > > www.accenture.com > -- Matt Sicker <boa...@gmail.com> ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy. ______________________________________________________________________________________ www.accenture.com --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org