Plugin screenshot thumbnail 1/3
Plugin screenshot thumbnail 2/3
Plugin screenshot thumbnail 3/3

Pushes Craft CMS logs to Sentry through a real Yii 2 log target.

Features

  • 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::error() and 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
  • 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

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. 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.

Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
2,305
Version
5.0.0-beta.1
License
MIT
Compatibility
Craft 3, Craft 4, Craft 5
Tested on Cloud
Last release
February 16, 2024
Activity (30 days)
1
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs