I'm trying to use JSON Template Layout and can't figure out why is the
"message" field contain the full stack trace and why aren't some exception
resolvers working. They are probably connected. Adding
"includeStackTrace": false to the message resolver didn't help.

I've attached my log output, the layout config and the JSON Template Layout
from the log4j2 file here -
https://gist.github.com/vthacker/1e129b739f171ac277926f3f62e4d559

What I was trying to achieve was

   1. Don't log the entire stack trace in the "message" field
   2. Populate the message with with just the exception message. Right now
   it's part of "exception.message" but still not getting populated
   3. Log only the "root_cause" part of the exception in a separate field


My primary motivation for this is stack traces get quite large and
downstream systems that ingest these logs try to cap the log size and some
stack traces get truncated . Hence only log the root cause and the error
message

Reply via email to