tailored-tunes / php-slack-error-reporter
A slack adapter for error reporting
Installs: 3 538
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: >=5.3.0
- tailored-tunes/php-slack-notifier: 1.*
Requires (Dev)
- phpunit/phpunit: 4.1.*
- squizlabs/php_codesniffer: 1.*
This package is not auto-updated.
Last update: 2021-11-18 09:54:10 UTC
README
Report errors directly to slack for quick fixes.
We use this only on our production environments. By the time the code gets deployed, in theory, it should never throw any errors or exceptions. When it does, it's important enough that we instantly get notified.
Installation
Install via composer. Installation help and versions at Packagist
Usage
Once you create the SlackErrorReporter
, it will register an error handler and an exception handler.
Those will take care of everything popping up to them.
use TailoredTunes\SlackNotifier; use TailoredTunes\SlackErrorReporter; $slackWebhookUrl = "http://team.slack.com/whatever"; $slack = new SlackNotifier($slackWebhookUrl); $usernameForMessage = $_ENV['WEB_NODE_NAME']; new SlackErrorReporter($slack, $usernameForMessage, '#errors', '#exceptions');