robuust / craft-sentry-log-target
Sentry Log Target for Craft 3
Package info
github.com/robuust/craft-sentry-log-target
Type:craft-plugin
pkg:composer/robuust/craft-sentry-log-target
Requires
- php: ^7.0 || ^8.0
- craftcms/cms: ^3.1
- olegtsvetkov/yii2-sentry: ^1.4
- php-http/guzzle6-adapter: ^1.0 || ^2.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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*'], ], ];