- SilverStripe ^4.0
- silverstripe/framework
- bugsnag/bugsnag
- guzzlehttp/guzzle
- silverstripe/admin
To install run the following command
composer require violet88/bugsnag-silverstripe
Note: Make sure the required modules are installed before using the module.
See License
For base use, add the following to your .env file
When running local, to prevent Bugsnag from being filled with errors, set BUGSNAG_ACTIVE to false OR do not declare it. (If not declared messages will also not be sent to Bugsnag.
BUGSNAG_API_KEY=<YOUR BUGSNAG API KEY>
BUGSNAG_STANDARD_SEVERITY=<STANDARD SEVERITY LEVEL FOR BUGSNAG (info OR warning OR error)>
BUGSNAG_ACTIVE=<true OR false, depending on whether bugsnag should be ACTIVE>
BUGSNAG_RELEASE_STAGE=<RELEASE STAGE FOR YOUR CURRENT REVISION>
For using the BugsnagLogger as the standard error logger, add the following to your configuration yaml
SilverStripe\Core\Injector\Injector:
Psr\Log\LoggerInterface:
calls:
BugsnagHandler: [pushHandler, ['%$BugsnagHandler']]
BugsnagHandler:
class: Violet88\BugsnagModule\BugsnagLogger
constructor:
- '%$Violet88\BugsnagModule\Bugsnag'
SilverStripe\SiteConfig\SiteConfig:
extensions:
- Violet88\BugsnagModule\BugsnagSiteConfigExtension
For using the CLI command to sent your current release revision to Bugsnag, add the following to your routes yaml
SilverStripe\Control\Director:
rules:
'bugsnag//build': 'Violet88\BugsnagModule\BugsnagController'
'bugsnag//initial': 'Violet88\BugsnagModule\BugsnagController'
For sending a basic error to Bugsnag, use the following code
use Violet88\BugsnagModule\Bugsnag;
use Exception;
use SilverStripe\Core\Injector\Injector;
try{
//do something
} catch (Exception $e) {
$bugsnag = Injector::inst()->get(Bugsnag::class);
$bugsnag->sendException($e);
}
- Sven van der Zwet [email protected]
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.
If the issue does look like a new bug:
- Create a new issue
- Choose the issue template for 'Bugs'
- Follow the instructions in the template
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
Feel free to join the community on slack: Join Slack