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

Add exceptionName for conversion pattern exception

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • Pattern Converters
    • None

    Description

      We are currently implementing an own JSON layout using the pattern layout including the %enc  conversion pattern. Unfortunately, it is not possible to get the exceptionName using the pattern layouts like in the JSON appender.

      Example exception:

      de.test.test.UnknownIdentifierException: CronJob with code test not found
      at de.test.test.service.Services.validateSingleResultWithType(Services.java:88)
      

      In the JSON Layout with includeStacktrace=true, there will be a new field thrown_name which includes only the exception name: 

      de.test.test.UnknownIdentifierException

       
      This would be helpful in the pattern layout, too. With this field a customer can filter for specific exceptions like for example Nullpointers.
      A possible implementation could be added to the exception pattern

      %ex{short.exceptionName}

      Attachments

        Activity

          People

            Unassigned Unassigned
            ka51m1r Christian
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: