Chapter plan
What you will complete
01SLF4J, Logback & Log LevelsMeet the logging facade every Spring class already uses, pick the right level per event, and stop paying for string building nobody reads.Call SLF4J loggers with parameterized messagesMap events to ERROR, WARN, INFO, and DEBUG consistentlyConfigure level per package in application.yml 20 min02Production Logging & RedactionLog exceptions with stack traces and context, shape parseable messages, and keep secrets and personal data out of every line.Pass the Throwable so stack traces surviveAdd identifiers (user, request, entity) not object dumpsRedact passwords, tokens, keys, card data, and PII before shipping 25 min
Module outcome
Diagnose failures from logs alone because messages carry context, levels carry meaning, and nothing sensitive leaks.
Mental model
A log line is a message to your future self at 3 a.m.; write it with the context you will wish you had then.
Module checkpoint
Auditable task API
Add leveled, parameterized logging with exception context and a redaction review to the REST slice.
- DEBUG stays silent in prod, INFO tells the story
- One logged exception shows stack trace plus correlation id
- Zero sensitive fields in any emitted line
Final module assessment
Ready to prove mastery?
Complete all 50 questions after finishing the module lessons and checkpoint.