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

Pattern layout %notEmpty does not work for exceptions

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.10.0
    • None
    • Pattern Converters
    • None

    Description

      Using a pattern layout that contains something like:

      %notEmpty{EXCEPTION: %throwable}

      kind of works. However, when the Exception is not empty, it prints the Exception to the appender twice: once in the proper position within the pattern, and then again completely separately, with a newline before the second output.

      Note that the second output completely ignores any formatting specifications, such as separator or level-based ansi coloring – it seems as if the output of Exception.toString() had been sent to the appender directly).

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rocketraman Raman Gupta

            Dates

              Created:
              Updated:

              Slack

                Issue deployment