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

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

m8rge/yii-sentry-log
====================

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

1.1.0(7y ago)01.2k3PHP

Since Jul 18Pushed 7y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

Yii Sentry Log
==============

[](#yii-sentry-log)

Yii sentry log is a component for Yii to send all logging and exception to sentry server instead of showing it on screen or save it on files, especially when you set `YII_DEBUG` to `false`, this module based on [raven-php](https://github.com/getsentry/raven-php) by [getsentry](https://github.com/getsentry)

RSentryComponent can be used to have proper trace back messages to use with the yii log

Requirement
-----------

[](#requirement)

- Yii Framework &gt;1.1.x
- [Sentry](https://www.getsentry.com/)

Configuring
-----------

[](#configuring)

- Put your clone or copy all files to `/protected/components/yii-sentry-log`
- Edit your `config.php`

```
    ...
    'components'=>array(
    	...
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'application.components.yii-sentry-log.RSentryLog',
                    'dsn'=> '[YOUR_DSN_FROM_SENTRY_SERVER]',
                    'levels'=>'error, warning',
                    // optional
                    //     adds to user context values from arrays or objects chains from $GLOBAL
                    //     skips if anything from the chain is absent (respects attributes, but not other getters)
                    //     NB! default values for user context will disappear and these values will be added
                    'context' => [
                        // adds $GLOBALS['_SESSION']['user']->username under 'nameOfUser' key
                        'nameOfUser' => ['_SESSION', 'user', 'username'],
                        // adds $GLOBALS['_SESSION']['user']->username under '_SESSION:user:email' key
                        ['_SESSION', 'user', 'email'],
                        // adds $GLOBALS['_SESSION']['optionalObject']->someProperty['someSubKey'] value, skips if absent
                        'optionalValue' => ['_SESSION', 'optionalObject', 'someProperty', 'someSubKey'],
                    ]
                ),
            ),
        ),
        ...
    )
    ...
```

- With RSentryComponent thanks to @BoontjieSA, just worked for `warning` level and unfortunately its not running on a public server at the moment.
- With both `error, warning` should use `exceptTitle` to avoid doubled Exceptions reports

```
    'preload'=> array('log', 'RSentryException'),
    'components'=>array(
    	...
    	'RSentryException'=> array(
    	    'dsn'=> '[YOUR_DSN_FROM_SENTRY_SERVER]',
            'class' => 'application.components.yii-sentry-log.RSentryComponent',
            // optional
            //     adds to user context values from arrays or objects chains from $GLOBAL
            //     skips if anything from the chain is absent (respects attributes, but not other getters)
            //     NB! default values for user context will disappear and these values will be added
            'context' => [
                // adds $GLOBALS['_SESSION']['user']->username under 'nameOfUser' key
                'nameOfUser' => ['_SESSION', 'user', 'username'],
                // adds $GLOBALS['_SESSION']['user']->username under '_SESSION:user:email' key
                ['_SESSION', 'user', 'email'],
                // adds $GLOBALS['_SESSION']['optionalObject']->someProperty['someSubKey'] value, skips if absent
                'optionalValue' => ['_SESSION', 'optionalObject', 'someProperty', 'someSubKey'],
            ]
    	),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'application.components.yii-sentry-log.RSentryLog',
                    'dsn'=> '[YOUR_DSN_FROM_SENTRY_SERVER]',
                    'levels'=>'error, warning',
                    // optional
                    //     adds to user context values from arrays or objects chains from $GLOBAL
                    //     skips if anything from the chain is absent (respects attributes, but not other getters)
                    //     NB! default values for user context will disappear and these values will be added
                    'context' => [
                        // adds $GLOBALS['_SESSION']['user']->username under 'nameOfUser' key
                        'nameOfUser' => ['_SESSION', 'user', 'username'],
                        // adds $GLOBALS['_SESSION']['user']->username under '_SESSION:user:email' key
                        ['_SESSION', 'user', 'email'],
                        // adds $GLOBALS['_SESSION']['optionalObject']->someProperty['someSubKey'] value, skips if absent
                        'optionalValue' => ['_SESSION', 'optionalObject', 'someProperty', 'someSubKey'],
                    ],
                    'exceptTitle' => [ // array of regex patterns
                        "/^exception '([^ ]*)' with message/",
                    ],
                ),
            ),
        ),
        ...
    )
    ...
```

Copyrights
----------

[](#copyrights)

Copyright (c) 2012 RoliesTheBee

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 53.8% 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 ~414 days

Total

5

Last Release

2662d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5da56097a7c9aced72f9d376741f2e061123d386fd9e86be9c5d3d1435c0bc7a?d=identicon)[m8rge](/maintainers/m8rge)

---

Top Contributors

[![m8rge](https://avatars.githubusercontent.com/u/575777?v=4)](https://github.com/m8rge "m8rge (21 commits)")[![rolies106](https://avatars.githubusercontent.com/u/1167249?v=4)](https://github.com/rolies106 "rolies106 (12 commits)")[![sheershoff](https://avatars.githubusercontent.com/u/1510318?v=4)](https://github.com/sheershoff "sheershoff (3 commits)")[![BoontjieSA](https://avatars.githubusercontent.com/u/2365149?v=4)](https://github.com/BoontjieSA "BoontjieSA (1 commits)")[![dcramer](https://avatars.githubusercontent.com/u/23610?v=4)](https://github.com/dcramer "dcramer (1 commits)")[![mn7z](https://avatars.githubusercontent.com/u/665947?v=4)](https://github.com/mn7z "mn7z (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/m8rge-yii-sentry-log/health.svg)](https://phpackages.com/packages/m8rge-yii-sentry-log)
```

###  Alternatives

[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[sentry/sentry-symfony

Symfony integration for Sentry (http://getsentry.com)

73761.4M66](/packages/sentry-sentry-symfony)[sentry/sdk

This is a meta package of sentry/sentry. We recommend using sentry/sentry directly.

327134.8M151](/packages/sentry-sdk)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[stayallive/wp-sentry

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.

379197.9k](/packages/stayallive-wp-sentry)[mito/yii2-sentry

Yii 2 extension for Sentry

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

PHPackages © 2026

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