Guide
Secure development
Logging without leaking personal data
What to put in logs so you can debug, and what must never appear: secrets, tokens, and unnecessary personal data.
Logs are a dataset. Treat them like one.
The fastest way to create a privacy incident is to log the full request body “just in case.” Personal data in logs is still personal data: it gets copied to support tools, SIEM trials and laptops.
A safer default
- Log a request id, user id (if you need it), route, status and duration.
- Redact Authorization headers, cookies, and password fields.
- Sample or hash emails if you only need to join events.
- Set retention. Infinite logs are infinite risk.
See observability and our privacy policy for how this site handles data.
Related
Last verified: August 2026. Technology and pricing change — always confirm current details with the vendor.