Yii 2 Errbit error handler
Logs errors to errbit, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist nkovacs/yii2-errbit "*"
or add, (*4)
"nkovacs/yii2-errbit": "*"
to the require section of your composer.json
file., (*5)
Usage
Replace the default error handler with either \nkovacs\errbit\WebErrorHandler
or \nkovacs\errbit\ConsoleErrorHandler
:, (*6)
...
'components' => [
'errorHandler' => [
'class' => 'nkovacs\errbit\ConsoleErrorHandler',
'errbit' => [
'api_key' => 'your api key',
'host' => 'errbit.example.org',
],
],
],
...
or, (*7)
...
'components' => [
'errorHandler' => [
'class' => 'nkovacs\errbit\ConsoleErrorHandler',
'errbit' => [
'api_key' => 'your api key',
'host' => 'errbit.example.org',
],
],
],
...
You can pass additional options to errbitPHP:, (*8)
...
'components' => [
'errorHandler' => [
'class' => 'nkovacs\errbit\ConsoleErrorHandler',
`errbit` => [
'api_key' => 'your api key',
'host' => 'errbit.example.org',
'environment_name' => 'development',
],
],
],
...
To enable the js notifier:, (*9)
...
'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., (*10)
If the controller implements UserInfoInterface
, the information returned by getErrbitUserInfo
will also be
sent to errbit., (*11)