Mdc Articles
2 articles about Mdc. Explore Spring Boot implementation, design, and operations across related topics.
-
Implementing Spring Boot's GlobalExceptionHandler for Production Use
This article explains how to implement Spring Boot's GlobalExceptionHandler (@RestControllerAdvice) with production-ready quality. It introduces implementation patterns needed in the operational phase, such as stack trace logging, traceID assignment via MDC, and custom property extensions to ProblemDetail, with concrete code examples.
-
How to Output JSON Structured Logs in Spring Boot - Production-Ready Setup with Logstash Encoder and MDC
Step-by-step guide to configuring Spring Boot to output logs in JSON format using logstash-logback-encoder. Covers how to automatically attach request IDs and user IDs via MDC, Spring Boot 3.4 native structured logging support, and environment-based profile switching.