nkovacs / yii2-errbit
Logs errors to [errbit](https://github.com/errbit/errbit)
Installs: 21 987
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 3
Open Issues: 1
Type:yii2-extension
Requires
- nkovacs/errbit-php: ~1.0.5
- yiisoft/yii2: ~2.0.4
This package is auto-updated.
Last update: 2024-10-25 03:22:27 UTC
README
Logs errors to errbit
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist nkovacs/yii2-errbit "*"
or add
"nkovacs/yii2-errbit": "*"
to the require section of your composer.json
file.
Usage
Replace the default error handler with either \nkovacs\errbit\WebErrorHandler
or \nkovacs\errbit\ConsoleErrorHandler
:
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', 'errbit' => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], ], ], ...
or
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', 'errbit' => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], ], ], ...
You can pass additional options to errbitPHP:
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\ConsoleErrorHandler', `errbit` => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', 'environment_name' => 'development', ], ], ], ...
To enable the js notifier:
... 'components' => [ 'errorHandler' => [ 'class' => 'nkovacs\errbit\WebErrorHandler', `errbit` => [ 'api_key' => 'your api key', 'host' => 'errbit.example.org', ], 'jsNotifier' => true, ], ], ...
You can pass additional options to the js plugin using the jsOptions
property.
If the controller implements UserInfoInterface
, the information returned by getErrbitUserInfo
will also be
sent to errbit.