JSON > free text.
"Structured logging" means each log line is a parseable record
(usually JSON) with named fields, e.g.:
{"ts":"2026-05-15T12:00Z","level":"info","user_id":42,"action":"login"}
Why is this preferred over `printf "user 42 logged in"` in production?
A) Looks cooler.
B) Log aggregators (Loki, Elastic, CloudWatch) can index, filter and
alert on fields without fragile regex parsing.
C) Smaller files.
D) Required by law.Sign in to save your code and track progress across devices.