Structured logging
pkg/logger provides shared structured logging on top of Go slog. It centralizes informational/error output used by startup, shutdown, event handling, and HTTP request logging.
Pass stable message names and structured key/value fields so request IDs and failure details can be traced without parsing prose. The HTTP middleware connects request logging to the Chi request lifecycle; Identity's guide explains request traces and operational error handling.
Do not log passwords, authorization headers, temporary tokens, full email bodies, or patient data as routine diagnostics. The console email adapter is a separate development transport that deliberately prints its message; it should not be mistaken for production-safe request logging. Existing logger and middleware tests verify output behavior.
Code reference
See the generated logger package.