Breaches are often discovered months later because nothing was logged — or logs existed but nobody was alerted. What to log (as structured JSON) Authentication events: login success/failure, MFA, password reset, lockouts Authorisation failures (403/404 on protected objects) Input validation failures and server errors Admin actions, permission changes, data exports Include who, what, when, where (user id, action, timestamp UTC, source IP, request id). What never to log Passwords, session tokens, API keys, full card numbers, secrets, or excessive personal data — mask them. Make it actionable Ship logs centrally (ELK, Splunk, Sentinel), protect them from tampering, define alerts (e.g. 20 failed logins/minute from one IP) and practise incident response.