Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3154

Support NameAbbreviator in ExceptionResolver when using JsonTemplateLayout

    XMLWordPrintableJSON

Details

    Description

      when stack traces are written to the JSON that is later consumed by Graylog for example sometimes the processing failed because the field containing the stack trace is larger than 32k which is a limit of the in ElasticSearch (https://github.com/Graylog2/graylog2-server/issues/873)

      I propose to add support for using the already existing NameAbbreviator to shorten stack traces. it might not completely solve all issues that the field might have content that is too large but tries to mitigate it.

         {
           "$resolver": "exception",
           "field": "stackTrace",
           "stackTrace": {
             "stringified": true
           }
         } 

      can be smth. like

         {
           "$resolver": "exception",
           "field": "stackTrace",
           "stackTrace": {
             "stringified": true,
             "abbreviatePattern": "1."
           }
         } 

      Attachments

        Activity

          People

            Unassigned Unassigned
            BigMichi1 Michael Cramer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: