W
W
WebDev2019-08-28 16:16:25
Laravel
WebDev, 2019-08-28 16:16:25

Logging to different Slack channels in Laravel?

Laravel has the ability to send logs to Slack. To do this, you need to specify which logs (error level) to send and create a webhook in slack.
It would be convenient to send errors of different levels to different channels. I didn't find it in the documentation. Does anyone know if this functionality exists?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-08-28
@kirill-93

Looks like something like this?

'channels' => [
    'slack-critical' => [
        'driver' => 'slack',
        'url' => env('LOG_SLACK_CRITICAL_WEBHOOK_URL'),
        'username' => 'Laravel critical',
        'emoji' => ':boom:',
        'level' => 'critical',
    ],
    'slack-debug' => [
        'driver' => 'slack',
        'url' => env('LOG_SLACK_DEBUG_WEBHOOK_URL'),
        'username' => 'Laravel debug',
        'level' => 'debug',
    ],
],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question