robuust/craft-sentry-log-target

This package is abandoned and no longer maintained. The author suggests using the diginov/craft-sentry-logger package instead.

Sentry Log Target for Craft 3

Installs: 27 019

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:craft-plugin

1.1.1 2021-01-27 08:26 UTC

This package is auto-updated.

Last update: 2021-03-04 11:53:34 UTC


README

Catches exceptions natively with Yii2's log component and sends them to Sentry.

Uses Sentry PHP SDK v2 via olegtsvetkov/yii2-sentry.

Requirements

This plugin requires Craft CMS 3.1.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require robuust/craft-sentry-log-target
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Sentry Log Target.

Configuration

Create a config/sentry-log-target.php config file with the following contents:

<?php

return [
    '*' => [
        'dsn'            => '$SENTRY_DSN' ?: 'https://example@sentry.io/123456789', // Set as string or use environment variable.
        'sentrySettings' => [], // Use options from Sentry PHP SDK as-is.
        'levels'         => ['error', 'warning'],
        'except'         => ['yii\web\HttpException:40*'],
    ],
];