# boolean_smtp_log_retention_days

> Filters the number of days email logs are kept before the daily cleanup removes them.

Filter · Tier A · Since 1.0.0

The value comes from the Settings screen (7 days to 1 year, default 30). Return `0` to keep logs forever, or any number of days the screen does not offer.

## Signature

```php
add_filter( 'boolean_smtp_log_retention_days', $callback, 10, 1 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$days` | `int` | Days to keep email logs. `0` disables pruning. |

**Returns** `int` — Days to keep email logs.

## Fires in

- [app/Jobs/PruneLogsJob.php:93](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Jobs/PruneLogsJob.php#L93) — `BooleanSmtp\Jobs\PruneLogsJob::handle()`

## Example

```php
add_filter( 'boolean_smtp_log_retention_days', function ( int $days ) {
    return $days;
}, 10, 1 );
```
