credy/yii2-errbit

Logs errors to [errbit](https://github.com/errbit/errbit)

1.0.0 2023-10-30 13:19 UTC

This package is auto-updated.

Last update: 2024-10-30 02:05:32 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 credy/yii2-errbit "*"

or add

"credy/yii2-errbit": "*"

to the require section of your composer.json file.

Usage

Replace the default error handler with either \credy\errbit\WebErrorHandler or \credy\errbit\ConsoleErrorHandler:

...
    'components' => [
        'errorHandler' => [
            'class' => credy\errbit\ConsoleErrorHandler::className(),
            'errbitApiKey' => 'apikey',
            'errbitHost' => 'test.example.org',
        ],
    ],
...

or

...
    'components' => [
        'errorHandler' => [
            'class' => credy\errbit\ConsoleErrorHandler::className(),
            'errbitApiKey' => 'apikey',
            'errbitHost' => 'test.example.org',
        ],
    ],
...

You can pass additional options to errbitPHP:

...
    'components' => [
        'errorHandler' => [
            'class' => credy\errbit\ConsoleErrorHandler::className(),
            'errbitApiKey' => 'apikey',
            'errbitHost' => 'test.example.org',
            'errbit' => [
                'environment_name' => 'development',
            ],
        ],
    ],
...

To enable the js notifier:

...
    'components' => [
        'errorHandler' => [
            'class' => credy\errbit\WebErrorHandler::className(),
            'errbitApiKey' => 'apikey',
            'errbitHost' => 'test.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.