Parametrize logging statement in presence of a Throwable
oakkitten opened this issue · comments
oakkitten commented
like this: http://www.slf4j.org/faq.html#paramException
almilli commented
To be more clear for this issue. When using the SLF4J adapter and using parameterized methods, it doesn't detect the Exception part and instead passes a null Exception to the underlying implementation.
Given this log, it only prints the message and does not include the stack trace.
String myParam = "testing";
Exception exception = new Exception();
log.info("Something happened. {}", myParam, exception);