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

Setting to disable extended stack trace for layouts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Layouts
    • None

    Description

      By default almost all layouts use an extended stack trace output format (ExtendedStackTraceElement). Currently I can change the stack trace format in PatternLayout by specifiyng its template (%throwable, %xThrowable, etc). When specified %throwable then no class packaging information is included in output.

      But when I use for example JsonLayout or AsyncAppender with any layout then no way to exclude class packaging information from the stack trace (this mean class loading from classpath for all stack trace elements). For performance reason would be good to have a setting to disable extending the stack trace in layouts.

      It's possible to add new attribute "extendedStackTrace" (for example, which is true by default) in layout elements (except PatternLayout and some other layouts where no ThrowableProxyHelper#toExtendedStackTrace is using). When I set extendedStackTrace="false" then stack trace must be serialized without class loading for all stack trace elements. AsyncAppender must use refs appender layout's attribute.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mikamj Mikhail Talisov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m