Log4j 2
  1. Log4j 2
  2. LOG4J2-48

Throwables in ParameterizedMessage

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.1
    • Fix Version/s: 0.1
    • Component/s: API
    • Labels:
      None

      Description

      ParameterizedMessage objects are capable of identifying throwables when provided as the last parameter in methods like:

      void info(String message, Object... params);

      but they are not properly logged. In addition, for some Logger methods, a throwable may be specified more than once for Message types that support throwables:

      void info(Message msg, Throwable t);

      See http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/201109.mbox/%3cDDC2E2A0-A4BA-4ED4-8F05-378152690CB9@gmail.com%3e

        Activity

        John Vasileff created issue -
        Hide
        John Vasileff added a comment -

        Patch to add getThrowable() to the Message interface and remove Logger methods that accept both a Message and Throwable.

        Show
        John Vasileff added a comment - Patch to add getThrowable() to the Message interface and remove Logger methods that accept both a Message and Throwable.
        John Vasileff made changes -
        Field Original Value New Value
        Attachment 0001-add-throwable-to-Message-objects-remove-from-log-met.patch [ 12494826 ]
        Hide
        Ralph Goers added a comment -

        I have corrected the Log4j 2.0 and SLF4J bridge to properly pass the throwable from ParameterizedMessage so that it is included in the LogEvent and will now be properly logged, so the actual defect being raised here has been resolved. Whether to include the Throwable in the Message interface or create a new ThrowableMessage is a separate topic that should be in its own Jira issue.

        Show
        Ralph Goers added a comment - I have corrected the Log4j 2.0 and SLF4J bridge to properly pass the throwable from ParameterizedMessage so that it is included in the LogEvent and will now be properly logged, so the actual defect being raised here has been resolved. Whether to include the Throwable in the Message interface or create a new ThrowableMessage is a separate topic that should be in its own Jira issue.
        Hide
        Ralph Goers added a comment -

        Per the previous comment I am marking this issue as fixed.

        Show
        Ralph Goers added a comment - Per the previous comment I am marking this issue as fixed.
        Ralph Goers made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Resolution Fixed [ 1 ]
        Hide
        Ralph Goers added a comment -

        Closing this issue since there have been no other comments since it was marked resolved.

        Show
        Ralph Goers added a comment - Closing this issue since there have been no other comments since it was marked resolved.
        Ralph Goers made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development