nkovacs / yii2-errbit
将错误记录到 [errbit](https://github.com/errbit/errbit)
0.1.3
2015-06-01 14:26 UTC
Requires
- nkovacs/errbit-php: ~1.0.5
- yiisoft/yii2: ~2.0.4
This package is auto-updated.
Last update: 2024-08-25 02:56:41 UTC
README
将错误记录到 errbit
安装
安装此扩展的首选方式是通过 composer.
运行以下命令之一:
php composer.phar require --prefer-dist nkovacs/yii2-errbit "*"
或添加
"nkovacs/yii2-errbit": "*"
到您的 composer.json
文件的 require 部分。
使用方法
替换默认的错误处理器,使用 \nkovacs\errbit\WebErrorHandler
或 \nkovacs\errbit\ConsoleErrorHandler
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', 'errbit' => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], ], ], ...
或
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', 'errbit' => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], ], ], ...
您可以为 errbitPHP 传递额外的选项
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', `errbit` => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', 'environment_name' => 'development', ], ], ], ...
启用 js 通知器
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\WebErrorHandler', `errbit` => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], 'jsNotifier' => true, ], ], ...
您可以使用 jsOptions
属性为 js 插件传递额外的选项。
如果控制器实现了 UserInfoInterface
,则 getErrbitUserInfo
返回的信息也将发送到 errbit。