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

Add more options to PatternLayout to display more detailed information about a Throwable

    Details

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

      Description

      That would be useful if we got more details about the method which threw the exception. There is a "short" form, which contains these information, but there can be some cases, when we need them separately.

      For example we would write something like this:

      %throwable{className}.%throwable{methodName}:%throwable{lineNumber} %throwable{message}
      

      And we would get this:

      foo.bar.ClassName.main:14 java.lang.ArithmeticException: / by zero
      

      I think we should only modify the ThrowablePatternConverter and ThrowableFormatOptions classes and the documentation. What do you think about it?

        Attachments

        1. LOG4J2-374_v2.patch
          13 kB
          Tibor Benke
        2. LOG4J2-374.patch
          11 kB
          Tibor Benke

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              btibi Tibor Benke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: