Why structured (JSON) logging, and what fields should every log line have?

BeginnerProductionLog Pipelines
Answer

Structured logs can be filtered and aggregated without fragile regex. Standard fields:

{"ts":"2026-11-09T10:15:02.113Z","level":"error","service":"checkout","env":"prod",
 "trace_id":"4bf92f3577b34da6a3ce929d0e0e4736","span_id":"00f067aa0ba902b7",
 "msg":"payment authorization failed","order_id":"o-82913","error":"card_declined","duration_ms":412}

trace_id is the key one: it links logs to traces. Agree on field names org-wide (OpenTelemetry semantic conventions are a good base).

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Log Pipelines