Log4j 2
  1. Log4j 2
  2. LOG4J2-1

Custom rendering of exception associated with logging event

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-alpha1
    • Component/s: Layouts
    • Labels:
      None

      Description

      In http://marc.info/?l=log4j-user&m=120898200413495&w=2, Robert Pepersack essentially asks for a method of overriding the use of Exception.printStackTrace() to capture the stack trace of the associated exception. This can partially be done in log4j 1.x by providing a custom layout that returns false for ignoresThrowable and then performs the rendering of the exception as part of the layout. However, it would not affect LoggingEvents that were deserialized. Also, if an AsyncAppender is used, the layout would be rendering an exception after it may have been modified.

      The log4j 2 pipeline should not have this issue as the extraction phase done by the layout should pull any info needed from the exception and the responsibility would not be split among WriterAppender, ThrowableInformation and the layout. So likely there is no additional design criteria involved here, just the final design should be checked that it satisfies this use case.

        Activity

        Curt Arnold created issue -
        Hide
        Ralph Goers added a comment -

        The experimental version of Log4J 2.0 doesn't use printStackTrace() to obtain the stack. The ThrowableProxy is serialized when needed.

        Show
        Ralph Goers added a comment - The experimental version of Log4J 2.0 doesn't use printStackTrace() to obtain the stack. The ThrowableProxy is serialized when needed.
        Ralph Goers made changes -
        Field Original Value New Value
        Comment [ 这个是log4j的2版本么?为啥没有下载链接啊??? ]
        Hide
        Ralph Goers added a comment -

        Log4j 2 formats the stacktrace using either the ThrowablePatternConverter, ExtendedThrowablePatternConverter or RootThrowablePatternConverter. The email link above says he is looking for the full stacktrace, which Log4j 2 produces by default.

        Show
        Ralph Goers added a comment - Log4j 2 formats the stacktrace using either the ThrowablePatternConverter, ExtendedThrowablePatternConverter or RootThrowablePatternConverter. The email link above says he is looking for the full stacktrace, which Log4j 2 produces by default.
        Ralph Goers made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Fix Version/s 2.0-alpha1 [ 12320347 ]
        Resolution Fixed [ 1 ]
        Hide
        Ralph Goers added a comment -

        Closing this issue since there have been no further updates.

        Show
        Ralph Goers added a comment - Closing this issue since there have been no further updates.
        Ralph Goers made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1466d 15h 13m 1 Ralph Goers 30/Apr/12 08:33
        Resolved Resolved Closed Closed
        72d 11h 32m 1 Ralph Goers 11/Jul/12 20:05

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Curt Arnold
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development