PHPackages                             lesha888/yii2-sentry - 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. lesha888/yii2-sentry

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

lesha888/yii2-sentry
====================

Sentry for the Yii2 PHP framework.

1.3.2(8y ago)0195BSD-3-ClausePHP

Since Oct 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lesha888/yii2-sentry)[ Packagist](https://packagist.org/packages/lesha888/yii2-sentry)[ RSS](/packages/lesha888-yii2-sentry/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (11)Used By (0)

yii-sentry
==========

[](#yii-sentry)

[![Latest Stable Version](https://camo.githubusercontent.com/d94f3c0d00485aae1948698595830719b912c1004aa5b2608108f19da8a467ad/68747470733a2f2f706f7365722e707567782e6f72672f637269737538332f7969692d73656e7472792f762f737461626c652e706e67)](https://packagist.org/packages/crisu83/yii-sentry)

Sentry for the Yii PHP framework 2.

ecom/sentry is an extension for Yii2 that allows for sending data to [Sentry](http://getsentry.com). It comes with an application component that allows for centralized access to the Raven client, an error handler that sends errors and exception to Sentry and a log route that sends log messages to Sentry. It has never been this easy to professionally manage your errors.

Features
--------

[](#features)

- Application component for easy access to the Raven client
- Error handler that sends errors to Sentry
- Log route that sends messages to Sentry

Resources
---------

[](#resources)

- [Sentry](http://getsentry.com)
- [Sentry docs](http://sentry.readthedocs.org/en/latest/)
- [Raven project](http://github.com/getsentry/raven-php)

Setup
-----

[](#setup)

The easiest way to install this extension is to use [Composer](http://getcomposer.org) by adding the following to your composer.json file:

```
  "require": {
    "lesha888/yii2-sentry": "^1.3"
  }
```

Run the following command in the root directory of your project to install the extension:

```
php composer.phar install
```

> TIP: Create a path alias to Composer's vendor directory called **vendor** to ease class mapping to dependencies by adding it to `aliases` in your application configuration.

If you do not want to use Composer, you can download the extension and its dependencies and set everything up manually.

Once you have downloaded the extension add the following to your application configuration:

```
  'components' => array(
    'sentry' => array(
      'class' => lesha888\sentry\Component::class,
      'enabled' => true,
      'dsn' => ''
    ),
  ),
```

The following configuration parameters are available for the SentryClient:

- **dsn**: (string) dsn to use when connecting to Sentry
- **environment**: (string) name of the active environment
- **enable**: (bool) to skip collecting errors
- **enabledEnvironments**: (array) list of names for environments in which data will be sent to Sentry
- **options**: (array) options to pass to the Raven client with the following structure:
    - **logger**: (string) name of the logger
    - **auto\_log\_stacks**: (bool) whether to automatically log stacktraces
    - **name**: (string) name of the server
    - **site**: (string) name of the installation
    - **tags**: (array) key/value pairs that describe the event
    - **trace**: (bool) whether to send stacktraces
    - **timeout**: (int) timeout when connecting to Sentry (in seconds)
    - **exclude**: (array) class names of exceptions to exclude
    - **shift\_vars**: (bool) whether to shift variables when creating a backtrace
    - **processors**: (array) list of data processors

Sending errors to Sentry
------------------------

[](#sending-errors-to-sentry)

To enable the SentryErrorHandler add the following to your application configuration:

```
  'components' => array(
    'errorHandler' => array(
      'class' => lesha888\sentry\ErrorHandler::class,
    ),
  ),
```

The following configuration parameters are available for the SentryErrorHandler:

- **sentryClientID**: (string) component ID for the sentry client

That's it, now errors and exceptions will be sent to Sentry.

Sending log messages to Sentry
------------------------------

[](#sending-log-messages-to-sentry)

To enable the SentryLogRoute add the following to your application configuration:

```
  'components' => array(
    'log' => array(
      'class' => 'CLogRouter',
      'routes' => array(
        array(
          'class' => lesha888\sentry\LogRoute::class,
          'levels' => 'error, warning',
        ),
      ),
    ),
  ),
```

The following configuration parameters are available for the SentryLogRoute:

- **sentryClientID**: (string) component ID for the sentry client

That's it, now log messages with levels **error** and **warning** will be sent to Sentry.

> TIP: Do not log messages with level **trace** to Sentry because it will slow down your application a lot.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 74.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~186 days

Recently: every ~372 days

Total

9

Last Release

3106d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/528980?v=4)[Oleksii](/maintainers/lesha888)[@lesha888](https://github.com/lesha888)

---

Top Contributors

[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (23 commits)")[![lesha888](https://avatars.githubusercontent.com/u/528980?v=4)](https://github.com/lesha888 "lesha888 (4 commits)")[![bixuehujin](https://avatars.githubusercontent.com/u/1145280?v=4)](https://github.com/bixuehujin "bixuehujin (3 commits)")[![motin](https://avatars.githubusercontent.com/u/793037?v=4)](https://github.com/motin "motin (1 commits)")

---

Tags

logexceptionerrorsentryyii2

### Embed Badge

![Health badge](/badges/lesha888-yii2-sentry/health.svg)

```
[![Health](https://phpackages.com/badges/lesha888-yii2-sentry/health.svg)](https://phpackages.com/packages/lesha888-yii2-sentry)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[baibaratsky/yii2-rollbar

Rollbar for Yii2

35130.5k](/packages/baibaratsky-yii2-rollbar)[facile-it/sentry-module

This module allows integration of Sentry Client into laminas and mezzio

19372.5k](/packages/facile-it-sentry-module)[mito/yii2-sentry

Yii 2 extension for Sentry

92377.7k](/packages/mito-yii2-sentry)[e96/yii2-sentry

A Yii2 client for Sentry (http://getsentry.com)

2960.4k](/packages/e96-yii2-sentry)[phptek/sentry

Sentry.io integration for SilverStripe. Binds Sentry.io to SilverStripe's error &amp; exception handling subsystem.

15203.5k3](/packages/phptek-sentry)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
