Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8797

Logging with SLF4J produces wrong output when using multiple parameters in format

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.0.0.Final
    • Fix Version/s: 6.1.0
    • Component/s: Logging
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Log using SLF4J and more than two log parameters.

      e.g.:

      logger.debug ( "Logging - Level: {}, Action: {}, Result: {}, UserData: {}, Reference: {}/{}", new Object[]

      { level, action, result, data, referenceType, referenceId }

      );

      Show
      Log using SLF4J and more than two log parameters. e.g.: logger.debug ( "Logging - Level: {}, Action: {}, Result: {}, UserData: {}, Reference: {}/{}", new Object[] { level, action, result, data, referenceType, referenceId } );
    • Estimated Difficulty:
      Low

      Description

      Logging with SLF4J and passing parameters as Object[] produces wrong output in the JBoss log:

      e.g.: logger.debug ( "Logging - Level: {}, Action: {}, Result: {}, UserData: {}, Reference: {}/{}", new Object[]

      { level, action, result, data, referenceType, referenceId }

      );

      produces

      Logging - Level: <parameter #1 as Object[]>, Action: {}, Result: {}, ....

      It seems to me that instead of handling the Object[] that is passed as array is used later on as simple Object which reduces the provided parameters to 1 instead. There seems to be no problem with the log calls that take one or two objects (which are separate methods in SLF4J).

      I would consider it major since it scrambles all logging messages using the Object[] methods.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jaikiran Jaikiran Pai (Inactive)
              Reporter:
              ctron Jens Reimann (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: