Created
October 5, 2018 08:40
-
-
Save yoX64/67439cba4df2bd483d23c928370e75ea to your computer and use it in GitHub Desktop.
Sending Slack notifications with monolog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
$logger = new \Monolog\Logger('GeneralLogger'); | |
$slackHandler = new \Monolog\Handler\SlackHandler('slack-token', '#channel', 'username'); | |
$logger->pushHandler($slackHandler); | |
$slackHandler->setLevel(\Monolog\Logger::ERROR); | |
$logger->error("Just an ERROR message. It works!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment