lukeyouell / craft-sentry
Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience.
Installs: 121 292
Dependents: 1
Suggesters: 0
Security: 0
Stars: 17
Watchers: 0
Forks: 9
Open Issues: 3
Type:craft-plugin
Requires
- craftcms/cms: ^3.1
- sentry/sentry: ^1.10
README
Sentry plugin for Craft CMS 3
Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience.
Installation
Requirements
This plugin requires Craft CMS 3.1.0, or later.
Plugin Store
Log into your control panel and click on 'Plugin Store'. Search for 'Sentry'.
Composer
- Open your terminal and go to your Craft project:
cd /path/to/project
- Then tell Composer to load the plugin:
composer require lukeyouell/craft-sentry
- In the Control Panel, go to Settings → Plugins and click the “Install” button for Sentry.
Configuring Sentry
Upon successful installation you will be required to supply a client key (DSN).
Client keys can be found in your project settings underneath 'Client Keys (DSN)'.
A Sentry account is required, if you don't already have one click here to create one.
Free & paid plans are available.
Overriding Plugin Settings
If you create a config file in your config
folder called sentry.php
, you can override the plugin’s settings in the Control Panel. Since that config file is fully multi-environment aware, this is a handy way to have different settings across multiple environments.
We recommend storing your client key as an environment variable.
Here’s what that config file might look like along with a list of all of the possible values you can override.
<?php return [ 'enabled' => true, 'clientDsn' => '$SENTRY_DSN', // NOT getenv('SENTRY_DSN') 'environment' => '$SENTRY_ENVIRONMENT', // NOT getenv('SENTRY_ENVIRONMENT') 'excludedCodes' => '400, 404, 429', // Comma-separated list ];
Your .env
file would store the above values like so:
SENTRY_DSN=https://55bb06663931567d9ee5bed445c6348a@sentry.io/289748
SENTRY_ENVIRONMENT=my-sentry-environment
Brought to you by Luke Youell