---
title: Log file retention
description: Configure PingIDM audit log file-retention policies in audit.json or the legacy admin UI to control how long log files remain on disk.
component: pingidm
version: 8.1
page_id: pingidm:audit-guide:audit-log-file-retention
canonical_url: https://docs.pingidentity.com/pingidm/8.1/audit-guide/audit-log-file-retention.html
llms_txt: https://docs.pingidentity.com/pingidm/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Audit", "Logs", "Configuration", "Retention"]
---

# Log file retention

Log file retention specifies how long audit files remain on disk before they are automatically deleted.

To configure log file retention, set the following properties in your project's `audit.json` file:

```json
"fileRetention" : {
    "maxNumberOfHistoryFiles" : 100,
    "maxDiskSpaceToUse" : 1000,
    "minFreeSpaceRequired" : 10
},
```

The file retention properties are described in [JSON Audit Event Handler Properties](audit-config-prop-json.html).

In the legacy admin UI, click Configure > System Preferences > Audit, and edit the JSON audit event handler (or the CSV audit event handler if you're logging to CSV). You can set all the log retention properties on this screen.
