Structured logging
On This Lesson 4 topics
The content for this lesson is written and waiting for review. The outline below shows what it covers. It will be published once it is approved.
In this lesson
explain why logs can be JSON.
Planned topics
- Text logs are for people; JSON logs are for machines too.
- A JSON line has named fields: time, level, message, orderId.
- Log tools can search and count by field.
- Context values (like a request ID) can be attached to every line (MDC).
- Switch format by configuration, not by code.
Draft outline details
Demonstration
{"time":"2025-01-10T10:15:02Z","level":"INFO","logger":"OrderService","message":"Order placed","orderId":42}Check your understanding
Why JSON logs?
Show answer
Machines can search and filter by field.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.