承接 baibaratsky/yii-rollbar 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

baibaratsky/yii-rollbar

最新稳定版本:v2.3.3

Composer 安装命令:

composer require baibaratsky/yii-rollbar

包简介

Rollbar Yii Extension

README 文档

README

Packagist Dependency Status Packagist Packagist

Rollbar Yii Component is the way to integrate Rollbar service with your Yii 1.* application. For Yii2 use yii2-rollbar.

The code of this project has been forked from Ratchetio Component.

Installation

  1. The preferred way to install this component is through composer.

    To install, either run

    $ php composer.phar require baibaratsky/yii-rollbar:2.3.*
    

    or add

    "baibaratsky/yii-rollbar": "2.3.*"
    

    to the require section of your composer.json file.

  2. Add rollbar component to the main.php config:

    // ...
    'components' => array(
        // ...
        'rollbar' => array(
            'class' => 'application.vendor.baibaratsky.yii-rollbar.RollbarComponent', // adjust path if needed
            'access_token' => 'your_serverside_rollbar_token',
        ),
    ),
  3. Adjust main.php config to preload the component:

    'preload' => array('log', 'rollbar'),
  4. Set RollbarErrorHandler as error handler:

    'components' => array(
        // ...
        'errorHandler' => array(
            'class' => 'application.vendor.baibaratsky.yii-rollbar.RollbarErrorHandler',
            // ...
        ),
    ),

    You can also pass some additional rollbar options in the component config, refer to the Rollbar documentation for all available options.

    A good idea is to specify environment as:

    'environment' => isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'cli_' . php_uname('n'),

    You can specify alias of your project root directory for linking stack traces (application by default):

    'root' => 'root',

Rollbar Log Route

You may want to collect your logs produced by Yii::log() in Rollbar. Put the following code in your config and enjoy:

'components' => array(
    // ...
    'log' => array(
        // ...
        'routes' => array(
            array(
                'class' => 'application.vendor.baibaratsky.yii-rollbar.RollbarLogRoute',
                'levels' => 'error, warning, info',

                // You may specify the name of the Rollbar Yii Component ('rollbar' by default)
                'rollbarComponentName' => 'rollbar',
            ),
        ),
    ),
),

统计信息

  • 总下载量: 32.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-01-17