The Silverstripe Bugsnag Logger sends your error notifications to Bugsnag.
Tested to work with both Silverstripe 2.4 and 3.x applications.
The recommended way is using Composer.
Add both this repository and the original bugsnag project to your project's composer.json
file
"require": {
"evolution7/silverstripe-bugsnag-logger": "1.*"
}
After this simply run
$ composer install
or
$ composer update evolution7/silverstripe-bugsnag-logger
Alternatively, if your project does not use Composer you can import the repository as a submodule.
$ git submodule add https://github.com/evolution7/silverstripe-bugsnag-logger bugsnag-logger
$ git submodule add https://github.com/bugsnag/bugsnag-php.git vendor/bugsnag
$ git submodule update --recursive --init
After installation, all you need to do is add the following line to your _config.php to enable the Bugsnag Logger.
E7_BugsnagLogger::enableWithApiKey(API-KEY-HERE);
Calling the enableWithApiKey
method will return the Bugsnag_Client object from the official bugsnag-php library. To see what is possible with that, please see the documentation on their Github page.
Bugsnag allows you to determine which release stage you are currently in, the Bugsnag Logger uses a ReleaseStage class for this which determines this based on the path, but it is possible to override this by providing your own ReleaseStage class as an optional second parameter when calling enableWithApiKey
. This class will have to implement the ReleaseStageInterface to ensure it has the required methods.
E7_BugsnagLogger::enableWithApiKey(API-KEY-HERE, new CustomReleaseStage());
- Fork it on Github
- Make the changes you'd like to see
- Make a pull request
- Thanks!