Audit Logging: What Actually Works
Recording who did what and when in an application, separately from technical error logs.
On this page
Where most projects go wrong
The usual mistakes:
- Audit data mixed into debug logs
- Logs users can alter
- Unbounded retention of personal data
- Logs nobody can query
What good looks like instead
- Log security-relevant actions consistently
- Store audit logs separately from application data
- Protect logs from modification
- Define retention aligned with obligations
- Make logs searchable for investigations
Why it matters
Audit trails answer security and compliance questions, and they are useless if they are written after the fact.
The specs that matter
| Measure | Figure |
|---|---|
| Contents | actor, action, target, time and source |
| Immutability | audit records should not be editable by application users |
| Retention | audit logs often have defined retention periods |
| Privacy | logs can contain personal data |
Knowing when to hand it over
Tip: Bring in help when compliance requires activity records.
Where this comes from
- OWASP — Logging Cheat Sheet
- National Institute of Standards and Technology — Security and Privacy Controls
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.