PHPackages                             diginov/craft-sentry-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. diginov/craft-sentry-logger

ActiveCraft-plugin[Logging &amp; Monitoring](/categories/logging)

diginov/craft-sentry-logger
===========================

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

5.0.3(2mo ago)5183.6k↓52.1%8[1 issues](https://github.com/diginov/craft-sentry-logger/issues)[1 PRs](https://github.com/diginov/craft-sentry-logger/pulls)3MITPHP

Since Oct 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/diginov/craft-sentry-logger)[ Packagist](https://packagist.org/packages/diginov/craft-sentry-logger)[ RSS](/packages/diginov-craft-sentry-logger/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (52)Used By (3)

[![Sentry Logger Icon](src/icon.svg)](src/icon.svg)

Sentry Logger for Craft CMS
===========================

[](#sentry-logger-for-craft-cms)

Pushes Craft CMS logs to [Sentry](https://sentry.io/) through a real Yii 2 log target.

[![Sentry Logger Screenshot](screenshot.png)](screenshot.png)

Features
--------

[](#features)

- Updated to the latest and official Sentry SDK
- Native Yii 2 log target that is fully customizable
- 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

Requirements
------------

[](#requirements)

This plugin requires PHP 8.2 or later and Craft CMS 5.0 or later.

Installation
------------

[](#installation)

To install this plugin, search for **Sentry Logger** on the Craft Plugin Store and click **Install** or run the following terminal commands in your Craft project folder to install it with Composer:

```
composer require diginov/craft-sentry-logger
php craft plugin/install sentry-logger
```

Basic configuration
-------------------

[](#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.

```
