[Bug 240] New: Log4jLoggerAdapter.log(...) ignores argument array

http://bugzilla.slf4j.org/show_bug.cgi?id=240 Summary: Log4jLoggerAdapter.log(...) ignores argument array Product: SLF4J Version: 1.6.x Platform: PC OS/Version: Linux Status: NEW Severity: blocker Priority: P1 Component: Implementations AssignedTo: slf4j-dev@qos.ch ReportedBy: simone.bordet@gmail.com The implementation of Log4jLoggerAdapter.log(Marker marker, String callerFQCN, int level, String msg, Object[] argArray, Throwable t) seems to assume that the the "msg" parameter is the formatted message, not the format string. The same class, however, contains other methods that perform correct formatting of the format string. Therefore, either a clarification in the javadocs of LocationAwareLogger is needed to specify that the "msg" parameter must already be the formatted message, or the implementation in Log4jLoggerAdapter is missing the formatting step. Thanks ! -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=240 John Vasileff <git@netcc.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |git@netcc.us --- Comment #1 from John Vasileff <git@netcc.us> 2011-09-14 18:25:44 CEST --- (In reply to comment #0) Looking at callers of this method, I assume the former (possible doc issue.) See: https://github.com/ceki/slf4j/blob/v_1.6.2/slf4j-ext/src/main/java/org/slf4j... -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=240 --- Comment #2 from Simone Bordet <simone.bordet@gmail.com> 2011-09-14 19:33:26 CEST --- Uhm... lots of code duplication in the link you posted, and what would be the arguments parameter for if the message is already formatted ? -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=240 --- Comment #3 from John Vasileff <git@netcc.us> 2011-09-14 20:32:34 CEST --- (In reply to comment #2)
Uhm... lots of code duplication in the link you posted, and what would be the arguments parameter for if the message is already formatted ?
I'm not an authority on this, but I believe "Object[] argArray" should hold the original arguments (minus the bug 70 trailing Throwable) if they are available, or null. I don't think Log4jLoggerAdapter has a use for the argArray since formatting is performed by the caller, but other classes that implement LocationAwareLogger may use them for filtering, serialization, etc. In bug 241 I proposed a patch that removes some of the duplication in LoggerWrapper: https://github.com/jvasileff/slf4j/blob/210e4fa2c2efc32c2e9f1397b5448c39f6bf... FWIW, I recently proposed an updated 2.0 API that would provide further simplifications. A possible new Log4jLoggerAdapter: https://github.com/jvasileff/slf4j/blob/98458fe317c9446e2d1024f7089daf22eb3f... John -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@pixie.qos.ch