Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meadsteve/monosnag
🐛 Monolog handler for bugsnag.
https://github.com/meadsteve/monosnag
Last synced: 17 days ago
JSON representation
🐛 Monolog handler for bugsnag.
- Host: GitHub
- URL: https://github.com/meadsteve/monosnag
- Owner: meadsteve
- License: mit
- Created: 2014-03-04T12:12:45.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T12:00:54.000Z (over 3 years ago)
- Last Synced: 2024-10-11T03:11:12.127Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 43 KB
- Stars: 20
- Watchers: 4
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
MonoSnag
==========
[![Test PHP 7 & 8](https://github.com/meadsteve/MonoSnag/actions/workflows/php.yml/badge.svg)](https://github.com/meadsteve/MonoSnag/actions/workflows/php.yml)
[![Latest Stable Version](https://poser.pugx.org/mead-steve/mono-snag/v/stable.svg)](https://packagist.org/packages/mead-steve/mono-snag)
[![License](https://poser.pugx.org/mead-steve/mono-snag/license.svg)](https://packagist.org/packages/mead-steve/mono-snag)
[![Monthly Downloads](https://poser.pugx.org/mead-steve/mono-snag/d/monthly.png)](https://packagist.org/packages/mead-steve/mono-snag)[Monolog](https://seldaek.github.io/monolog/) Handler connection to [Bugsnag](http://bugsnag.com)
Installation
------------
Via Composer using
```shell
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.```php
$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")));```