Plain logs from five services interleave into noise โ impossible to follow one request. Switch on structured logs with a shared trace id, filter to one id, and the request's whole journey across services reconstructs itself.
Two requests are running at the same time โ a booking (A) and a report download (B). Toggle structured logging and try to follow just one of them.
Log stream
00:00:00 POST /book received
00:00:00 GET /report received
00:00:00 token validated (alice)
00:00:00 token validated (bob)
00:00:00 creating booking #88213
00:00:00 fetching report #5521
00:00:00 charge timed out after 8s
00:00:00 report ready
00:00:00 fallback: pending payment
00:00:00 200 OK
๐ No ids, two requests mixed together โ which 'timed out' line belongs to the booking? You can't tell. This is most logging.
What just happened
โนPlain text logs from many services interleave into noise. When two requests run at once, their lines mix together and you can't tell which line belongs to which request.
โนStructured logs attach fields โ service, level, and crucially a trace_id (correlation id) created at the edge and passed to every service. Filter by one trace_id and the entire journey of that single request reconstructs itself across services, in order.
โนAlso: never log secrets, tokens, or full patient records. Log enough to debug (ids, actions, status, latency) and nothing that would itself be a breach if the logs leaked.