Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

robuust/craft-sentry-log-target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentry Log Target plugin for Craft

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://[email protected]/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*'],
    ],
];