Agent Wranglers

OPS-10Required EU law

Keep logs for a fixed time

Keep logs only as long as you need them, delete them on a schedule, and say how long in the privacy policy.

Region

European Union (EU). The duty comes from the law there. The rule applies only when the project serves people there, and its Applies when also holds.

How to do it

Set rotation and deletion in the log store, such as logrotate, journald MaxRetentionSec or the retention setting of a hosted service. Weeks are usually enough for debugging. Security logs may need longer, so keep them apart with their own limit, as keep audit logs for a set time says. Email delivery logs follow the same idea, as in lean email logs.

Examples

Plain text example

/var/log/shop/*.log {
  daily
  rotate 14
  compress
  missingok
}

How to check

The oldest file or entry in each log store is younger than its stated limit, and the privacy policy names the same limit.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/operations/logs/log-retention">Agent Wranglers operations and observability playbook</a>. In code you write, add a comment next to it with the same link.