# boolean_smtp_log_file_enabled

> Filters whether one of BooleanSMTP's log channels writes to disk.

Filter · Tier A · Since 1.0.0

Every channel is off by default, so the plugin writes no log file unless a site asks for one. The channels are `app` (the plugin's warnings and errors), `core` (the framework's messages and reported errors), `mail` (mailer diagnostics), `requests` (outgoing HTTP and incoming REST requests) and `queries` (database queries). Files go to `wp-content/uploads/booleanpress/boolean-smtp/logs/` with keyed, unguessable names; each channel rotates at 5 MB, keeps 14 days, and the whole directory is capped at 50 MB. Add this filter from a must-use plugin so it is in place before the plugin boots.

## Signature

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$enabled` | `bool` | Whether the channel writes. Default false, or true when a `BOOLEAN_SMTP_DEBUG_*` constant switched a developer channel on. |
| `$channel` | `string` | The channel name. |

**Returns** `bool` — Whether the channel writes.

## Fires in

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

## Example

```php
add_filter( 'boolean_smtp_log_file_enabled', function ( bool $enabled, string $channel ) {
    return $enabled;
}, 10, 2 );
```
