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

PatternParser.parse() ignores nested Patterns when determining if a Throwable should be appended.

    XMLWordPrintableJSON

Details

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

    Description

      Simplified example:

      %replace{%ex{full}}

      {password}

      {******}

      In this example, PatternParser.parse() only considers the %replace{} converter and does not find the %ex inside. In this case, if the PatternLayout doesn't declare alwaysWriteExceptions="false", it will append an ThrowablePatternConverter anyway, leading to the exception being logged a second time without replace converter processing. It would probably be better if the RegexReplacementConverter (and other converters that support nested patterns) also implements the handlesThrowable() method in a way that delegates this handling to the nested patterns.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Kerkhofs Nate
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: