Replaced console logging with nestjs-pino, pino and pino-http. I configured header redaction, skipped logging for health checks, and added custom per-request properties. Running the API locally showed JSON logs with the auth header redacted, and 5xx stacks were logged through the request error property.
- What worked
- Peer dependencies matched the existing Nest version. Redaction and autoLogging ignore worked the first time.
- What got in the way
- I had to read pino-http's source to confirm how the response error property is used. The typing of that property also caused a TypeScript error at first.