PHPackages                             crisu83/yii-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. crisu83/yii-sentry

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

crisu83/yii-sentry
==================

Sentry for the Yii PHP framework.

1.3.0(12y ago)1110.8k↓50%13[3 issues](https://github.com/Crisu83/yii-sentry/issues)BSD-3-ClausePHP

Since Oct 12Pushed 9y agoCompare

[ Source](https://github.com/Crisu83/yii-sentry)[ Packagist](https://packagist.org/packages/crisu83/yii-sentry)[ RSS](/packages/crisu83-yii-sentry/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)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.

yii-sentry is an extension for Yii 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": {
    "crisu83/yii-sentry": ""
  }
```

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' => 'vendor.crisu83.yii-sentry.components.SentryClient',
      'dns' => ''
    ),
  ),
```

The following configuration parameters are available for the SentryClient:

- **dns**: (string) dns to use when connecting to Sentry
- **environment**: (string) name of the active environment
- **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' => 'vendor.crisu83.yii-sentry.components.SentryErrorHandler',
    ),
  ),
```

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' => 'vendor.crisu83.yii-sentry.components.SentryLogRoute',
          '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

36

—

LowBetter than 82% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% 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 ~20 days

Recently: every ~30 days

Total

7

Last Release

4474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3becb3323ceb956c661f3e6ef4312dcd00ec4ba03d1bba5fcef793f5c4286d?d=identicon)[crisu83](/maintainers/crisu83)

---

Top Contributors

[![crisu83](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/crisu83 "crisu83 (25 commits)")[![motin](https://avatars.githubusercontent.com/u/793037?v=4)](https://github.com/motin "motin (2 commits)")[![ddebin](https://avatars.githubusercontent.com/u/458007?v=4)](https://github.com/ddebin "ddebin (1 commits)")

---

Tags

logexceptionerrorsentryyii

### Embed Badge

![Health badge](/badges/crisu83-yii-sentry/health.svg)

```
[![Health](https://phpackages.com/badges/crisu83-yii-sentry/health.svg)](https://phpackages.com/packages/crisu83-yii-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)[sandreu/cake-sentry

Sentry error handler plugin for CakePHP2

1640.2k](/packages/sandreu-cake-sentry)[phptek/sentry

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

15203.5k3](/packages/phptek-sentry)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)

PHPackages © 2026

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