patrickfischer / monolog-slack-safe
A non fatal version of the Monolog SlackWebhookHandler
Package info
github.com/zero0cool0/patrickfischer-monolog-slack-safe
pkg:composer/patrickfischer/monolog-slack-safe
1.0.4
2026-10-08 07:45 UTC
Requires
- monolog/monolog: ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A non fatal version of the Monolog SlackWebhookHandler which does not throw on curl error, but uses error_log() as a final fallback.
Installation
Install it with composer:
composer require patrickfischer/safeslackwebhookhandler
Update config/logging.php to use the handler like so:
use PatrickFischer\SafeSlackWebhookHandler;
return [
// other configuration
'channels' => [
// other channels
'safe_slack' => [
'driver' => 'monolog',
'handler' => SafeSlackWebhookHandler::class,
'with' => [
'webhookUrl' => env('LOG_SLACK_WEBHOOK_URL'),
'channel' => '#absolutebackup',
'username' => env('LOG_SLACK_USER'),
'useAttachment' => true,
'iconEmoji' => env('LOG_SLACK_EMOJI', 'https://api.iconify.design/fluent-emoji-flat/alarm-clock.svg'),
'useShortAttachment' => false,
'includeContextAndExtra' => false,
'level' => env('LOG_LEVEL_SLACK', 'error'),
'excludeFields' => [],
'retries' => 1,
'timeout_ms' => 1000,
],
],
]
];
License
MIT