[slf4j-user] Last parameter being exception is not mentioned in javadoc

David Karr davidmichaelkarr at gmail.com
Tue Nov 13 18:15:24 CET 2018


I'm currently using slf4j-api v1.7.25.

The javadoc for "Logger.error(String format, Object arg1, Object arg2)" and
"Logger.error(String format, Object... arguments)" does not mention
anything about what happens if any of the parameters are Throwable objects.

However, https://www.baeldung.com/slf4j-log-exceptions shows an example of
passing an exception object as the last parameter, after the string format
parameters, showing that it will properly log the exception just as if the
"(String, Throwable)" method was called.

I know that the Logger class itself is an interface, but if it's the aim of
the library that every implementation of this interface will have the same
behavior in any particular aspect, then that behavior should be documented
in the javadoc for the interface.

I see that this behavior isn't even documented in the small "slf4j manual"
page.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20181113/07ac05be/attachment.html>


More information about the slf4j-user mailing list