Change: Violated with Laravel 5.6
The Log Facade is really just a wrapper for the base Monolog instance. The good news is that Monolog supports Slack. You just need to tell Monologue to use it.
With that said, everything can be configured in 3 lines of code.
$monolog = \Log::getMonolog(); $slackHandler = new \Monolog\Handler\SlackHandler('your-token', '#your-channel', 'Monolog', true, null, \Monolog\Logger::ERROR); $monolog->pushHandler($slackHandler);
Then, to launch it, you can either create your own service provider for it, or simply delete it in the AppServiceProvider boot AppServiceProvider .
You might want to take a look at the SlackHandler source code in case you need to use more options that the constructor uses.
Now whenever you \Log::error('some error'); , this error message will be sent to the configured Slack channel. Please note that this pop-up window means that it will be sent to the Slack channel for any error related to registration, error , critical , alert and emergency . Set the bubble parameter to false if you want it to only register error s.
source share