# boolean_smtp_log_file_retention_days

> Filters how many days of a BooleanSMTP log channel's files are kept.

Filter · Tier A · Since 1.0.0

Values below 1 are treated as 1: there is no setting that keeps log files forever.

## Signature

```php
add_filter( 'boolean_smtp_log_file_retention_days', $callback, 10, 2 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$days` | `int` | Days to keep, today included. Default 14. |
| `$channel` | `string` | The channel name. |

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

## Fires in

- [app/Support/Logging/LogChannels.php:227](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Support/Logging/LogChannels.php#L227) — `BooleanSmtp\Support\Logging\LogChannels::retentionDays()`

## Example

```php
add_filter( 'boolean_smtp_log_file_retention_days', function ( int $days, string $channel ) {
    return $days;
}, 10, 2 );
```
