rexlmanu / mono-snag
Bugsnag integration for monolog. An abstract handler that sends messages to Bugsnag
4.2.0
2025-03-13 01:10 UTC
Requires
- php: ^7.2 || ^8.0
- bugsnag/bugsnag: ^3.4
- monolog/monolog: ^3.0
Requires (Dev)
- phpspec/prophecy: ^1.20
- phpunit/phpunit: ^8.5.8 || ^9.4.2
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-03-13 01:13:07 UTC
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")));