The unsafe default
Debug logging captures tokens, API keys, and user data, then replicates them across many systems.
Failure modes to watch
- Request/response dumps in production
- Logging authorization headers by default
- Long retention of sensitive traces
Safer implementation patterns
- Redact known secret patterns at ingest.
- Define safe logging contracts per service.
- Require elevated access for raw logs.
Minimum controls for small teams
- Secret scanners for logs and CI artifacts.
- Short retention for sensitive event streams.
- Key rotation playbook for leak response.
Builder note: Security posture is mostly defaults and review discipline, not heroics.