Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.6 won't log to Slack

Tags:

laravel

slack

Currently my config/logging.php channels section contains like the following:

'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'slack'],
    ],

Then in my slack section I have set a webhook using the Incoming Webhooks section in Slack. https://slack.com/apps/A0F7XDUAZ-incoming-webhooks

Other incoming webhooks I've set for other application (not Laravel) have all worked perfectly.

When I call the following:

Log::channel('stack')->info('test'); then it successfully logs to the file, but not to Slack.

or

Log::channel('slack')->info('test'); just seemingly does nothing.

In my Slack channels as I add the configuration I can see the notification "added an integration to this channel: Laravel Log"

Not sure what else to do to even troubleshoot this or get it working?

like image 784
Octoxan Avatar asked Aug 09 '18 14:08

Octoxan


1 Answers

Make sure info is not below the specified minimum level for messages to be escalated to Slack in config/logging.php.

like image 90
Tobias K. Avatar answered Nov 18 '22 11:11

Tobias K.