PHPackages                             sorokinmedia/yii2-rollbar - 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. sorokinmedia/yii2-rollbar

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

sorokinmedia/yii2-rollbar
=========================

Rollbar for Yii2

077PHP

Since Jan 4Pushed 6y ago7 watchersCompare

[ Source](https://github.com/sorokinmedia/yii2-rollbar)[ Packagist](https://packagist.org/packages/sorokinmedia/yii2-rollbar)[ RSS](/packages/sorokinmedia-yii2-rollbar/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Rollbar for Yii2
================

[](#rollbar-for-yii2)

[![Packagist](https://camo.githubusercontent.com/3498a2f23c4c5e513d6f8fabf8b0bc6ac565793e45bc61f68cf5d520e6f4bba4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736f726f6b696e6d656469612f796969322d726f6c6c6261722e737667)](https://github.com/sorokinmedia/yii2-rollbar/blob/master/LICENSE.md)[![Packagist](https://camo.githubusercontent.com/4237f22408a8dfc185e1985592ccd5567efebd0c82a9645dca888edfc5378751/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f726f6b696e6d656469612f796969322d726f6c6c6261722e737667)](https://packagist.org/packages/sorokinmedia/yii2-rollbar)

This extension is the way to integrate [Rollbar](http://rollbar.com/) service with your Yii2 application.

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

[](#installation)

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

To install, either run

```
$ php composer.phar require sorokinmedia/yii2-rollbar

```

or add

```
"sorokinmedia/yii2-rollbar": "dev-master"

```

to the `require` section of your `composer.json` file.

If you want to use it with **Yii prior to 2.0.13**, you need yii2-rollbar of the version `1.6.*`.

Usage
-----

[](#usage)

1. Add the component configuration in your *global* `main.php` config file:

```
'bootstrap' => ['rollbar'],
'components' => [
    'rollbar' => [
        'class' => \sorokinmedia\rollbar\Rollbar::class,
        'accessToken' => 'YOUR_ACCESS_TOKEN',
        'environment' => 'local',
        'root' => '@root',
        // You can specify exceptions to be ignored by yii2-rollbar:
        'ignoreExceptions' => [
            ['yii\web\HttpException', 'statusCode' => [400, 403, 404]],
            ['yii\web\ForbiddenHttpException', 'statusCode' => [403]],
            ['yii\web\UnauthorizedHttpException', 'statusCode' => [401,403]],
        ],
    ],
],
```

1. Add the *web* error handler configuration in your *web* config file:

```
'components' => [
    'errorAction' => 'site/error',
    'class' => \sorokinmedia\rollbar\web\ErrorHandler::class,

    // You can include additional data in a payload:
    'payloadDataCallback' => function (\sorokinmedia\rollbar\web\ErrorHandler $errorHandler) {
        return [
            'exceptionCode' => $errorHandler->exception->getCode(),
            'rawRequestBody' => Yii::$app->request->getRawBody(),
        ];
    },
],
```

1. Add the *console* error handler configuration in your *console* config file:

```
'components' => [
    'errorHandler' => [
        'class' => \sorokinmedia\rollbar\console\ErrorHandler::class,
    ],
],
```

Log Target
----------

[](#log-target)

You may want to collect your logs produced by `Yii::error()`, `Yii::info()`, etc. in Rollbar. Put the following code in your config:

```
'log' => [
    'targets' => [
        [
           'class' => \sorokinmedia\rollbar\log\Target::class,
           'levels' => ['error', 'warning', 'info'], // Log levels you want to appear in Rollbar

           // It is highly recommended that you specify certain categories.
           // Otherwise, the exceptions and errors handled by the error handlers will be duplicated.
           'categories' => ['application'],
        ],
    ],
],
```

The log target also appends `category` and `request_id` parameters to the log messages. `request_id` is useful if you want to have a *yii2-debug*-like grouping.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6071315?v=4)[Ruslan Gilyazetdinov](/maintainers/Ma3oBblu)[@Ma3oBblu](https://github.com/Ma3oBblu)

---

Top Contributors

[![Ma3oBblu](https://avatars.githubusercontent.com/u/6071315?v=4)](https://github.com/Ma3oBblu "Ma3oBblu (6 commits)")

### Embed Badge

![Health badge](/badges/sorokinmedia-yii2-rollbar/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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