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

ActiveYii2-extension[Logging &amp; Monitoring](/categories/logging)

dmftaras/yii2-sentry
====================

Yii 2 extension for Sentry

v1.0.3(4y ago)0308[2 PRs](https://github.com/dmftaras/yii2-sentry/pulls)MITPHPPHP &gt;=7.4.0

Since May 3Pushed 8mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

Yii 2 - Sentry Error Logger
===========================

[](#yii-2---sentry-error-logger)

[Sentry](https://getsentry.com/) provides real-time crash reporting for web apps, both server and client side. This is a Yii 2 extension which lets you integrate your projects to Sentry and log PHP and JavaScript errors.

Brought to you by [dmftaras](http://dmftaras.com).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist dmftaras/yii2-sentry "~1.0.0"

```

or add the following line to the require section of your `composer.json` file:

```
"dmftaras/yii2-sentry": "~1.0.0"

```

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

[](#requirements)

Yii 2 and above. Sentry 9 and above.

You can use this extension with both the hosted and on-premise version of Sentry.

Usage
-----

[](#usage)

Once the extension is installed, set your configuration in common config file:

```
    'components' => [
        'sentry' => [
            'class' => 'dmftaras\sentry\Component',
            'dsn' => 'YOUR-PRIVATE-DSN', // private DSN
            'environment' => 'staging', // if not set, the default is `production`
            'release' => '1.0' // release version
        ],
        'log' => [
            'targets' => [
                [
                    'class' => 'dmftaras\sentry\Target',
                    'levels' => ['error', 'warning'],
                    'except' => [
                        'yii\web\HttpException:404',
                    ],
                ],
            ],
        ],
    ],
```

To skip collecting errors in the development environment, disable the component with this parameter:

```
    'components' => [
        'sentry' => [
            'enabled' => false,
        ],
    ],
```

To collect error manually

```
try {
    throw new \Exception('fatal error');
} catch (\Exception $e) {
    \Yii::$app->sentry->captureException($e);
}
```

To collect custom message

```
\Yii::$app->sentry->captureMessage('test msg');
```

License
-------

[](#license)

Code released under [MIT License](LICENSE).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance43

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~211 days

Total

4

Last Release

1566d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0.0

v1.0.3PHP &gt;=7.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2745744?v=4)[Taras Kostetskyi](/maintainers/dmftaras)[@dmftaras](https://github.com/dmftaras)

---

Top Contributors

[![dmftaras](https://avatars.githubusercontent.com/u/2745744?v=4)](https://github.com/dmftaras "dmftaras (7 commits)")

---

Tags

sentryyii2extension

### Embed Badge

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

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

###  Alternatives

[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)

PHPackages © 2026

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