Pushes Craft CMS logs to Sentry through a real Yii 2 log target.
- Updated to the latest and official Sentry SDK
- Native Yii 2 log target that is fully customisable
- All errors and warnings for each request are sent
- Plugin settings can be defined in the CP or with a config file
- Options passed when Sentry SDK initializes can be customized
- Calls for
Craft::warning()are sent and categorized
- Anonymous option to prevent sensitive visitors and users data from being sent to Sentry
Additional data pushed to Sentry
- Request type (web, ajax or console)
- Request method, headers and body
- Request route including query string
- Script executed including parameters (console request)
- User ID, email, username and groups (sensitive data)
- Visitor IP address (sensitive data)
- Visitor cookies (sensitive data)
- Database driver type and version
- Image driver type and version
- Craft edition, licence, schema and version
devModestatus taken from general config
- Craft current environment taken from
- Twig template path and line number for exceptions in compiled templates
This plugin requires PHP 7.2 or later and Craft CMS 3.5 or later.
You can configure the plugin settings directly in the CP or you can create a
config/sentry-logger.php config file with the following contents. Make sure to update your
.env environment file accordingly with the correct values.
<?php use craft\helpers\App; return [ '*' => [ 'enabled' => false, 'anonymous' => false, 'dsn' => App::env('SENTRY_DSN'), 'release' => App::env('SENTRY_RELEASE'), 'environment' => App::env('SENTRY_ENVIRONMENT'), 'levels' => ['error', 'warning'], 'exceptCodes' => [403, 404], 'exceptPatterns' => , ], 'staging' => [ 'enabled' => true, ], 'production' => [ 'enabled' => true, ], ];
Advanced configuration and parameters
Read through the documentation to know how to use the advanced configuration method and all the available parameters.