Skip to content

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

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

Parameters

ParameterTypeDescription
$enabledboolWhether the channel writes. Default false, or true when a `BOOLEAN_SMTP_DEBUG_*` constant switched a developer channel on.
$channelstringThe channel name.

Returns bool — Whether the channel writes.

Fires in

Example

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

Next steps

  • Log files — every hook in this area, in firing order where that applies.
  • Hook Explorer — filter and search every hook.