phptek / sentry
Sentry.io integration for SilverStripe. Binds Sentry.io to SilverStripe's error & exception handling subsystem.
Installs: 146 873
Dependents: 4
Suggesters: 2
Security: 0
Stars: 11
Watchers: 3
Forks: 22
Open Issues: 8
Type:silverstripe-vendormodule
Requires
- php: ^7|^8
- composer/package-versions-deprecated: ^1.11
- sentry/sdk: ^3
- silverstripe/framework: ^5
Requires (Dev)
- phpunit/phpunit: ^9
Replaces
- silverstripe/sentry: *
- dev-master
- 5.0.x-dev
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0
- 4.1.1
- 4.1
- 4.0.x-dev
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0-alpha3
- 4.0.0-alpha2
- 4.0.0-alpha1
- 3.0.x-dev
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-beta5
- 3.0.0-beta4
- 3.0.0-beta3
- 3.0.0-beta2
- 3.0.0-beta1
- 3.0.0-alpha1
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.0
- 0.7
- 0.6
- 0.5.1
- 0.5
- 0.4
- dev-5-dev
- dev-issue/silverstripe5-compat
- dev-issue/83
- dev-issue/65
- dev-issue/68
- dev-issue/69
- dev-2.2.2-wip
- dev-2.0-ss3
- dev-issue/64-missing-user-details
- dev-issue/42
- dev-ss4
- dev-issue/4
This package is auto-updated.
Last update: 2024-03-16 02:50:43 UTC
README
Sentry is an error and exception aggregation service. It takes your application's errors, aggregates them alongside configurable context and stores them for later analysis and debugging.
Imagine this: You see errors and exceptions before your clients do. The error > report > debug > patch > deploy cycle is therefore the most efficient it can possibly be.
This module binds Sentry.io and hosted Sentry installations, to the Monlog error logger in SilverStripe. If you've used systems like RayGun, Rollbar, AirBrake and BugSnag before, you'll know roughly what to expect.
Requirements
See composer.json
.
Setup:
composer require phptek/sentry
Notes:
- Version 5.x is aimed at Silverstripe 5.
- Versions 2.x, 3.x and 4.x should work with the same Silverstripe v4 setups. v3+ simply use newer versions of the Sentry PHP SDK and have additional bugfixes and features.
- Version 3.x
SentryClientAdaptor
has been renamed toSentryAdaptor
andSentryLogWriter
was renamed toSentryLogger
, so your existing configuration(s) may need to be updated accordingly.
Config
You can set your DSN as a first-class environment variable or via your project's .env
file:
SENTRY_DSN="http://deacdf9dfedb24ccdce1b90017b39dca:deacdf9dfedb24ccdce1b90017b39dca@sentry.mydomain.nz/44"
Or you can set it in YML config, where you gain a little more flexibility and control:
The following will get you errors reported in all environment modes: dev
, test
and live
:
---
Name: my-project-config-sentry
After:
- 'sentry-config'
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
opts:
# Example DSN only. Obviously you'll need to setup your own Sentry "Project"
dsn: http://deacdf9dfedb24ccdce1b90017b39dca:deacdf9dfedb24ccdce1b90017b39dca@sentry.mydomain.nz/44
Conditional Config
The following will get you errors reported just in test
and live
but not dev
:
---
Name: my-project-config-sentry
After:
- 'sentry-config'
---
---
Only:
environment: test
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
opts:
# Example DSN only. Obviously you'll need to setup your own Sentry "Project"
dsn: http://deacdf9dfedb24ccdce1b90017b39dca:deacdf9dfedb24ccdce1b90017b39dca@sentry.mydomain.nz/44
---
Except:
environment: test
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
opts:
# Example DSN only. Obviously you'll need to setup your own Sentry "Project"
dsn: http://deacdf9dfedb24ccdce1b90017b39dca:deacdf9dfedb24ccdce1b90017b39dca@sentry.mydomain.nz/44
---
Only:
environment: dev
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
opts:
dsn: null
---
Please review the usage docs for further configuration and customisation options.
Notes:
- You can silence errors from
Injector
where "test" and "live" envs havehttp_proxy
set, but "dev" environments don't. Just setnull
as the value. This applies to all YML config where some envs have a setting and others don't. For example:
...
---
Only:
environment: dev
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
opts:
dsn: null
http_proxy: null
---
...
-
As per the examples above, ensure your project's Sentry config is set to come after the module's own config, thus:
After: - 'sentry-config'
SilverStripe Framework v3
YML Config:
phptek\Sentry\Adaptor\SentryClientAdaptor:
opts:
# Example DSN only. Obviously you'll need to setup your own Sentry "Project"
dsn: http://deacdf9dfedb24ccdce1b90017b39dca:deacdf9dfedb24ccdce1b90017b39dca@sentry.mydomain.nz/44
mysite/_config.php:
SS_Log::add_writer(\phptek\Sentry\SentryLogWriter::factory(), SS_Log::ERR, '<=');
Usage
Sentry is normally setup once in your project's YML config or _config.php
file. See the above examples and the usage docs for details and options.
Support Me
If you like what you see, support me! I accept Bitcoin:
3KxmqFeVWoigjvXZoLGnoNzvEwnDq3dZ8Q |