mead-steve / mono-snag
Bugsnag integration for monolog. An abstract handler that sends messages to Bugsnag
Installs: 495 762
Dependents: 1
Suggesters: 0
Security: 0
Stars: 21
Watchers: 4
Forks: 14
Open Issues: 1
Requires
- php: ^7.2 || ^8.0
- bugsnag/bugsnag: ^3.4
- monolog/monolog: ^2.0
Requires (Dev)
- phpunit/phpunit: ^8.5.8 || ^9.4.2
- squizlabs/php_codesniffer: ^3.5
README
Monolog Handler connection to Bugsnag
Installation
Via Composer using
composer require mead-steve/mono-snag
Usage
A handler is provided that wraps up a Bugsnag client. By default, the handler will grab anything at Logger::ERROR and above and send it to Bugsnag.
$logger = new Monolog\Logger("Example"); $bugsnagClient = new Bugsnag\Client('YOUR-BUGSNAG-API-KEY-HERE'); //... bugsnag specific config goes here. $bugsnagHandler = new \MeadSteve\MonoSnag\BugsnagHandler($bugsnagClient); $logger->pushHandler($bugsnagHandler); // The following error will get sent automatically to Bugsnag $logger->addError("oh no!", array('exception' => new \Exception("ohnoception")));