Replace zap with log/slog #37

Merged
mikluko merged 1 commit from feat/slog into main 2026-10-26 21:19:16 +00:00
Owner

zap is gone from go.mod.

log.Middleware takes an access and a server *slog.Logger. The helpers take slog key-value arguments, and every request-scoped record is written with the request context, which the OpenTelemetry change builds on. Per-request sequence numbers, IDs, parent linkage and logger names work as before.

The command writes JSON access records to stdout without level or message, as before, and JSON server records to stderr. The visible format change is time replacing ts, plus upper-case levels.

Breaking for library users: Middleware's signature, slog arguments instead of zap.Field, and the removed zap encoder configs and log.Fatal.

zap is gone from `go.mod`. `log.Middleware` takes an access and a server `*slog.Logger`. The helpers take slog key-value arguments, and every request-scoped record is written with the request context, which the OpenTelemetry change builds on. Per-request sequence numbers, IDs, parent linkage and logger names work as before. The command writes JSON access records to stdout without level or message, as before, and JSON server records to stderr. The visible format change is `time` replacing `ts`, plus upper-case levels. Breaking for library users: `Middleware`'s signature, slog arguments instead of `zap.Field`, and the removed zap encoder configs and `log.Fatal`.
Replace zap with log/slog
All checks were successful
CI / changelog (pull_request) Successful in 6s
CI / test (pull_request) Successful in 1m34s
15023932e5
log.Middleware takes access and server slog loggers, and every request-scoped
record is written with the request context, which a context-aware handler
can read trace IDs from. The command writes JSON access records without level
or message to stdout and JSON server records to stderr, as before.
mikluko deleted branch feat/slog 2026-10-26 21:19:17 +00:00
Sign in to join this conversation.
No description provided.