lukeyouell/craft-sentry

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

Installs: 119 321

Dependents: 1

Suggesters: 0

Security: 0

Stars: 17

Watchers: 0

Forks: 10

Open Issues: 3

Type:craft-plugin

1.5.1 2019-03-12 16:00 UTC

This package is not auto-updated.

Last update: 2024-04-21 08:45:17 UTC


README

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://55bb06663931567d9ee5bed445c6348a@sentry.io/289748
SENTRY_ENVIRONMENT=my-sentry-environment

Brought to you by Luke Youell