# cleanup_update_logs

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/update_check/cleanup_update_logs)

Remove old update logs while preserving the newest recent logs.

## Signature

```python
cleanup_update_logs(
    *,
    retention_days: int = UPDATE_LOG_RETENTION_DAYS,
    max_files: int = UPDATE_LOG_MAX_FILES,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `retention_days` | `int` | No | Maximum age in days to keep. (default: `UPDATE_LOG_RETENTION_DAYS`) |
| `max_files` | `int` | No | Maximum number of newest log files to keep. (default: `UPDATE_LOG_MAX_FILES`) |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a98f0dfa8d534d8a1885b524632400e52db22ac6/libs/code/deepagents_code/update_check.py#L846)