Sentry Logger
Pushes Craft CMS logs to Sentry through a native Yii 2 log target.
Features
- Updated to the latest Sentry SDK version 3
- 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
- Calls for
Craft::error()
andCraft::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 cookies (sensitive data)
- Visitor IP address (sensitive data)
- Craft edition, licence, schema and version
- Craft
devMode
status taken from general config - Craft current environment taken from
CRAFT_ENVIRONMENT
- Twig template path and line number for exceptions in compiled templates
Requirements
This plugin requires PHP 7.2 or later and Craft CMS 3.5 or later.
Basic configuration
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:
<?php
use craft\helpers\App;
return [
'*' => [
'enabled' => false,
'anonymous' => false,
'dsn' => App::env('SENTRY_DSN'),
'release' => App::env('SENTRY_RELEASE'),
'levels' => ['error', 'warning'],
'exceptCodes' => [403, 404],
],
'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.
Free
Package Name
To install this plugin, search for its package name on the Plugin Store and click “Install”.