born05 / craft-sentry
Pushes Craft CMS errors to Sentry.
Installs: 114 157
Dependents: 3
Suggesters: 0
Security: 0
Stars: 9
Watchers: 8
Forks: 11
Open Issues: 7
Type:craft-plugin
Requires
- php: ^8.0.2
- craftcms/cms: ^4.0.0-alpha
- sentry/sdk: ^3.1.1
README
Pushes Craft CMS errors to Sentry.
Installation
Plugin Store
- Search for 'Sentry SDK'.
- Hit install
- Create a config file as explained below.
Composer
- Run:
composer require born05/craft-sentry
- Hit install in Admin > Settings > Plugins
- 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 return [ '*' => [ '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. 'excludedCodes' => ['400', '404', '429'], 'release' => getenv('SENTRY_RELEASE') ?: null, // Release number/name used by sentry. 'reportJsErrors' => false, 'sampleRate' => 1.0, ], ];
Credits
Based upon the sentry plugin by Luke Youell.
License
Copyright © Born05
See license