eroteev/yii2-rollbar
Composer 安装命令:
composer require eroteev/yii2-rollbar
包简介
Rollbar logging for Yii2 framework
README 文档
README
Simplified rollbar monitoring integration for Yii2 applications.
Installation
The preferred way to install this extension is through composer.
To install add
"eroteev/yii2-rollbar": "^1.0.0"
to the require section of your composer.json file.
Setup instructions
- Add the component configuration in your global config file:
'bootstrap' => ['rollbar'], 'components' => [ 'rollbar' => [ 'class' => 'eroteev\rollbar\Rollbar', 'config' => [ 'access_token' => 'POST_SERVER_ITEM_ACCESS_TOKEN', ] ], ],
- Add the web error handler configuration in your web config file:
'components' => [ 'errorHandler' => [ 'class' => 'eroteev\rollbar\error_handler\WebErrorHandler' ], ],
- Add the console error handler configuration in your console config file:
'components' => [ 'errorHandler' => [ 'class' => 'eroteev\rollbar\error_handler\ConsoleErrorHandler' ], ],
- Add log target in your global config file:
'log' => [ 'targets' => [ [ 'class' => 'eroteev\rollbar\log\RollbarTarget', 'levels' => ['error'], // Log levels you want to appear in Rollbar 'categories' => ['application'], ], ], ],
Ignore specific exceptions
To ignore specific exceptions you can update the component configuration in your global config file:
'components' => [ 'rollbar' => [ 'class' => 'eroteev\rollbar\Rollbar', 'config' => [ // ... 'check_ignore' => function ($isUncaught, $toLog, $payload) { return eroteev\rollbar\helpers\IgnoreExceptionHelper::checkIgnore($toLog, [ ['yii\web\HttpException', 'statusCode' => [400, 404]], ['yii\db\Exception', 'getCode' => [2002]], ] ); } ] ], ],
统计信息
- 总下载量: 39.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-28