logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Get thrown_name from JSON appender in RollingRandomAccessFile appender
Date Mon, 13 Aug 2018 18:53:33 GMT
Have you tried out the GELF layout?

On Mon, 13 Aug 2018 at 11:09, Fröstl, Christian <
christian.froestl@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 <boards@gmail.com>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message