Skip to main content

Mini Project: Request Logging with Levels and MDC

Learn Mini Project: Request Logging with Levels and MDC (Logging, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Request Logging with Levels and MDC Problem Support engineers need to follow one request through the logs: every line must carry a request id, noisy debug lines must be switchable, and errors must show the stack trace. Requirements Use SLF4J with parameterised messages. Switch the level at run time and show DEBUG disappears. Put a request id in the MDC so every line carries it. Log an exception with its stack trace, and capture the output to prove the format. Concepts Used SLF4J + Logback log levels parameterised logging MDC (correlation id) ListAppender to capture logs...

More lessons in Logging