https://github.com/born05/craft-sentry
Pushes Craft CMS errors to Sentry.
https://github.com/born05/craft-sentry
Last synced: over 1 year ago
JSON representation
Pushes Craft CMS errors to Sentry.
- Host: GitHub
- URL: https://github.com/born05/craft-sentry
- Owner: born05
- License: mit
- Created: 2019-11-26T09:21:38.000Z (over 6 years ago)
- Default Branch: craft4
- Last Pushed: 2024-06-13T12:45:03.000Z (about 2 years ago)
- Last Synced: 2025-03-24T18:46:11.438Z (over 1 year ago)
- Language: PHP
- Size: 64.5 KB
- Stars: 10
- Watchers: 6
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Sentry plugin for Craft CMS 4
Pushes Craft CMS errors to [Sentry](https://sentry.io/).
## Installation
### Plugin Store
1. Search for 'Sentry SDK'.
2. Hit install
3. Create a config file as explained below.
### Composer
1. Run: `composer require born05/craft-sentry`
2. Hit install in Admin > Settings > Plugins
3. Create a config file as explained below.
## Requirements
- Craft 4.0.0 and up
- PHP 8.0.2 and up
## Configuring Sentry
Create a `config/sentry-sdk.php` config file with the following contents:
```php
[
'enabled' => true,
'anonymous' => false, // Determines to log user info or not
'clientDsn' => getenv('SENTRY_DSN') ?: 'https://example@sentry.io/123456789', // Set as string or use environment variable.
'clientKey' => getenv('SENTRY_CLIENT_KEY') ?: 'z987654321a', // https://js.sentry-cdn.com/z987654321a.min.js
'excludedCodes' => ['400', '404', '429'],
'release' => getenv('SENTRY_RELEASE') ?: null, // Release number/name used by sentry.
'reportJsErrors' => false,
'sampleRate' => 1.0,
'ignoreErrors' => [
// Email link Microsoft Outlook crawler compatibility error
// cf. https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
"Non-Error promise rejection captured with value: Object Not Found Matching Id:",
]
],
];
```
## Credits
Based upon the sentry plugin by [Luke Youell](https://github.com/lukeyouell).
## License
Copyright © [Born05](https://www.born05.com/)
See [license](https://github.com/born05/craft-sentry/blob/master/LICENSE.md)