Skip to content

Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience.

License

Notifications You must be signed in to change notification settings

lukeyouell/craft-sentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icon

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.

Screenshot

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

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require lukeyouell/craft-sentry
  1. 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://[email protected]/289748
SENTRY_ENVIRONMENT=my-sentry-environment

Brought to you by Luke Youell

About

Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience.

Resources

License

Stars

Watchers

Forks

Packages

No packages published