[slf4j-dev] [Bug 213] New: LoggerAdapter.log() doesn't format the message with passed in parameters before displaying it

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Wed Jan 19 02:28:10 CET 2011


http://bugzilla.slf4j.org/show_bug.cgi?id=213

           Summary: LoggerAdapter.log() doesn't format the message with
                    passed in parameters before displaying it
           Product: SLF4J
           Version: 1.6.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.3
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Core API
        AssignedTo: slf4j-dev at qos.ch
        ReportedBy: tolik at cs.stanford.edu


This is likely a user error and/or misunderstanding, so apologies in advance.

I'm trying to port our code to the new 1.6.1 framework which changed
some LocationAwareLogger APIs.

In my SFL4J wrapper, i'm now calling through via the following method:

      
((LocationAwareLogger)logger).log(null,proxy,level,message,params,throwable);
the underlying logger API is:
Log4JLoggerAdapter.log, line 579 in 1.6.1
(https://github.com/ceki/slf4j/blob/master/slf4j-log4j12/src/main/java/org/slf4j/impl/Log4jLoggerAdapter.java#L579)
 public void log(Marker marker, String callerFQCN, int level, String msg,
     Object[] argArray, Throwable t) {

However, i notice that the incoming argArray is never "processed" in
that function, unlike al the error()  or debug() functions were
     FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
is called first before the message is printed .

In the Log4jLoggerAdapter.log() method the incoming message is coming
through without having the arguments applied to it.

Is that by design? should i be calling a different method? or is it a bug?

This same setup worked in 1.5.8 prior to 1.6.1

-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the slf4j-dev mailing list