Migrating a Production Service from Zap to slog: Notes from the Trenches

log/slog shipped in Go 1.21 in August 2023. It’s now been in the standard library for two years, and most production Go services I encounter are still on zap or zerolog. That’s not inertia — it’s a reasonable position. The third-party loggers are battle-tested and fast, and “the standard library now has one too” is not by itself a reason to migrate a working system. We migrated one of our services anyway. This post is about why, what the migration actually involved, and the honest accounting of what we gained and what we gave up. ...

October 7, 2025 · 7 min · MW

Structured Logging in Go: slog, zerolog, and What Actually Matters

Unstructured logging is a debugging tool. Structured logging is an observability tool. The difference: unstructured logs tell a human what happened; structured logs tell a machine what happened, and the machine can then tell a human efficiently. Unstructured: 2022-11-23 10:58:34 ERROR failed to process order ORD-12345 for user usr_abc: connection refused Structured: {"time":"2022-11-23T10:58:34Z","level":"ERROR","msg":"failed to process order", "order_id":"ORD-12345","user_id":"usr_abc","error":"connection refused", "service":"order-service","version":"1.2.3"} The structured log can be indexed, filtered, aggregated, and alerted on. order_id:ORD-12345 returns all logs for that order across all services. The unstructured log requires grep and hope. ...

November 23, 2022 · 5 min · MW
Available for consulting Distributed systems · Low-latency architecture · Go · LLM integration & RAG · Technical leadership
[email protected]