logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fröstl, Christian <christian.froe...@accenture.com>
Subject Get thrown_name from JSON appender in RollingRandomAccessFile appender
Date Mon, 13 Aug 2018 16:02:40 GMT
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

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:
But how to generate a field which only includes the thrown_name of the exception?

Thanks and greetings,


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.

View raw message