robuust / craft-sentry-log-target
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
Requires
- php: ^7.0 || ^8.0
- craftcms/cms: ^3.1
- olegtsvetkov/yii2-sentry: ^1.4
- php-http/guzzle6-adapter: ^1.0 || ^2.0
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.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require robuust/craft-sentry-log-target
-
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*'], ], ];