Logs are only useful if you can query them. A few conventions turn a wall of text into a searchable record of production behavior.
Structure Over Strings
Structured fields beat free-form messages. Stable keys like service, route, and status let you filter precisely instead of grepping.
level=info service=api-gateway route=/api/v1/projects status=200 ms=42
level=warn service=postgres-primary query=users.find ms=412
level=error service=billing-service trace_id=astk_trace_92jx status=500
Always Carry the Trace ID
A trace ID on every log line is the single most valuable field — it links the log to the full request path.
Log Decisions, Not Noise
Log the points where behavior branches or fails. High-volume debug logging buries the lines that matter.