Description:
Add structured request/response logging using Winston as an independent middleware layer, so every inbound HTTP request is logged with method, path, status code, and duration.
Tasks:
- Install
winston and nest-winston
- Create
src/common/middleware/logger.middleware.ts implementing NestMiddleware
- Log:
method, url, status, duration_ms, user_agent, ip
- Apply the middleware globally in
AppModule
- Replace default NestJS logger with Winston logger in
main.ts
- Add
LOG_LEVEL env var (debug, info, warn, error) to .env.example
Acceptance Criteria:
- Every request produces a structured log line in JSON format
- Log level is configurable via env var
- Sensitive headers (Authorization) are redacted from logs