[jboss-jira] [JBoss JIRA] Created: (JBLOGGING-53) Slf4jLogger wrong formatting in methods with Object arrays

Adam Michalik (JIRA) jira-events at lists.jboss.org
Wed Jan 5 08:12:18 EST 2011


Slf4jLogger wrong formatting in methods with Object arrays
----------------------------------------------------------

                 Key: JBLOGGING-53
                 URL: https://issues.jboss.org/browse/JBLOGGING-53
             Project: JBoss Logging
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: jboss-logging-logmanager
    Affects Versions: 3.0.0.Beta4-jboss-logging
         Environment: JBoss AS 6.0.0.Final
            Reporter: Adam Michalik
            Assignee: David Lloyd


Slf4jLogger in JBoss Logging Manager formats the messages in logging methods with Object array parameters (ie. info(String, Object[]), debug(String, Object[]) etc.) the wrong way. MessageFormatter.format(format, argArray) is used, but MessageFormatter.arrayFormat(format, argArray) should be used instead. Using the format() method results in putting the whole array in the first placeholder and leaving the following ones empty.

Example:

logger.info("1: {} 2: {} 3: {}", new Object[] { "ONE", "TWO", "THREE" });

Expected output:
1: ONE 2: TWO 3: THREE

Actual output:
1: [ONE, TWO, THREE] 2: {} 3: {}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list