Spring Boot JSON Logging: Making ELK Logs Filterable by Field
A payment callback fails intermittently, and ops cannot locate the order in Kibana, forcing a manual search through hundreds of thousands of plain-text lines. The core issue is that plain-text log lines carry no discrete fields, so the search engine cannot isolate values such as an order ID. The article explains that MDC values only become true fields when logs are emitted as JSON, not when they are merely spliced into a text pattern. It argues that Logstash grok parsing is brittle and CPU-costly, and that hand-built JSON breaks on quotes, newlines, and stack traces. Spring Boot's built-in structured logging offers three JSON formats, ECS, GELF, and Logstash, requiring no third-party dependencies.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in