Search code examples
laravelslack

Laravel 5.6 won't log to 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?


Solution

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