← Quiz: Docs and Production: all 10 questions
Quiz: Docs and Production · Question 9 of 10
In log.error("Payment failed for order {}", orderId, exception); why is the exception the last argument?
In log.error("Payment failed for order {}", orderId, exception); why is the exception the last argument?
- A.It is ignored there
- B.It replaces the {} placeholder
- C.SLF4J requires exactly two arguments
- D.SLF4J treats a final exception argument specially and logs its stack trace
Answer & explanation
Correct answer: SLF4J treats a final exception argument specially and logs its stack trace
Placeholders take the earlier arguments; the trailing exception is printed with its stack trace.
Can you get the rest right without peeking?
Take the timed Quiz: Docs and Production quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →