[logback-user] Using parameter markers and exceptions in non-Logback bindings

Ti Strga wearyofallthiscrap at gmail.com
Tue Jul 12 13:22:32 UTC 2016


There's an entry in the FAQ at
http://www.slf4j.org/faq.html#paramException asking how to
parameterize a logging statement when also passing an exception.  The
FAQ explains that the API will automatically figure it out, as long as
the last argument passed is the exception and not some other kind of
object.  (This would be nice to mention in the javadocs if feasible.)

My question:  the FAQ refers to SLF4J 1.6.0 and "the SLF4J API", but
the only place I saw this actually implemented was in logback-classic
(the LoggingEvent class in ch.qos.logback.classic.spi, not the
LoggingEvent in org.slf4j.event).  Are other implementations of the
SLF4J API expected to provide the same behavior?  Because the wording
makes it sound like SLF4J is doing the work on behalf of the
implementation, but obviously an interface class can't do that.  :-)

Am I just misinterpreting the FAQ?


thanks,
Ti


More information about the logback-user mailing list