# 62 — Structured logging ## Goal JSON logs for the app, easy to grep and ship later. ## Depends on - 02 ## Scope - `pino` for app logs; pretty-print only in dev. - Log levels via `LOG_LEVEL` env (default `info`). - Request log middleware (method, path, status, duration, userId if present). - Errors: capture stack + cause, never log secrets. ## Out of scope - Log shipping (Loki/etc). - Sentry/error tracking. ## Acceptance criteria - [ ] Production logs are single-line JSON. - [ ] No secret values appear anywhere in the log stream during a typical session. - [ ] Request logs include duration and userId when authenticated.