Keel

How long should a SaaS keep application logs under UK GDPR?

By the Keel team · Last checked · 4 min read

Short answer

UK GDPR does not set a fixed retention period for logs. It requires you to keep personal data no longer than necessary and to be able to justify the period you choose. In practice, most SaaS teams keep detailed application logs for weeks, security and audit logs for longer, and write the reasons down. Check the detail with a qualified adviser.

Why do logs fall under UK GDPR?

Application logs often contain IP addresses, user IDs, email addresses or request data, and that can make them personal data.

Where they do, the storage limitation principle applies: personal data should not be kept longer than you need it for the purpose you collected it.

The ICO's guidance on storage limitation is the place to read the principle in its own words. It sets no fixed periods. The practical consequence is that you choose a period, can explain it, and review it.

What does a practical retention scheme look like?

A practical scheme gives each type of log a period and a reason.

The periods below are examples to react to, not legal rules, and the right numbers depend on your product and your customers' contracts.

Example log retention, to adapt and justify
Log typeExample retentionReason
Debug and application logs14 to 30 daysTroubleshooting recent issues
Access and audit logs12 monthsSecurity investigations
Billing and legal recordsAs required by lawAccounting obligations

The shorter you can make the first row, the less personal data you hold and the less you have to explain.

How do you apply retention on AWS?

Set a retention period on every CloudWatch log group, because the default is to keep everything forever.

AWS's documentation says log data is stored indefinitely by default, and that you can configure how long to store it in each log group.

  • Set a retention period on every CloudWatch log group, including ones created by services you did not set up yourself.
  • Use S3 lifecycle rules to expire logs stored in buckets.
  • Avoid logging full request bodies, passwords or tokens.
  • Mask emails and IDs where you do not need them.

Shorter retention is also cheaper, which is covered in reducing CloudWatch Logs costs. The logs you do keep should be the ones minimum production monitoring relies on.

What should you avoid logging at all?

The safest personal data is data you never logged.

Keep these out of logs entirely, because no retention period fixes a secret that was written in plain text.

  • Passwords, tokens, API keys and session cookies.
  • Full request or response bodies that contain customer data.
  • Payment card data.
  • Special category data, such as health information.

Add a logging filter that masks known sensitive fields, and test it. One debug statement left in production can undo careful retention rules. Where to keep passwords and API keys covers the safer place for secrets.

How do deletion requests affect logs?

Logs are part of the data you hold about a person, so a deletion request can reach them.

Short retention helps a great deal, because personal data in debug logs ages out on its own within the period you chose.

For longer-kept audit logs, document why you keep them and whether you can remove or anonymise one person's entries on request. Restricting who can read audit logs helps justify keeping them. Whether a particular request can be refused or limited depends on the facts, so ask a qualified adviser rather than guessing.

How do you show buyers you have thought about it?

Keep a one-page logging policy.

It supports your records under UK GDPR and answers a common section of enterprise questionnaires, so writing it once saves time on every one.

  1. Each log source and its purpose.
  2. The personal data it may contain.
  3. Its retention period and where that is enforced.
  4. Who can access it.

Pair it with the answers in the security questionnaire guide. Review the periods when your product changes, not only when someone asks.

Can you keep security logs longer than application logs?

Yes, if you can justify it.

Audit and security logs are often kept longer than debug logs because they are needed to investigate incidents, and a log you no longer have cannot show what happened.

Write the reason down, limit access, and avoid putting more personal data in those logs than the investigation needs. If a customer contract sets its own retention or deletion terms, those can override your default for that customer's data. This is general information, not legal advice.

Is your log retention under control?

Tick each item that is true today.

  • Every CloudWatch log group has a retention period set.
  • Each log type has a period and a written reason.
  • Secrets and full request bodies are not logged.
  • Access to audit logs is restricted.
  • You know how a deletion request would reach your logs.
  • A one-page logging policy exists.

Decision point: Five or six ticks: your logging is well governed. Three or fewer: start with a retention period on every log group today.

Sources

  1. ICO, Principle (e): Storage limitation (checked November 2026)
  2. AWS docs, Working with log groups and log streams (checked November 2026)
  3. AWS, Shared Responsibility Model (checked October 2026)

Keep reading

Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.