luckyshopteam/yii2-sentry

There is no license information available for the latest version (2.0.3) of this package.

Yii2 sentry

2.0.3 2019-10-01 08:41 UTC

This package is auto-updated.

Last update: 2024-03-29 03:51:00 UTC


README

Установка

composer require luckyshopteam/yii2-sentry @dev

Подключение

Подключите класс SentryComponent в компонентах приложения

'components' => [
    'sentry' => [
        'class' => luckyshopteam\sentry\SentryComponent::class,
        'enabled' => true,
        'dsn' => getenv('SENTRY_DSN'),
        'environment' => YII_ENV, // if not set, the default is `production`
    ],
],

Добавьте класс SentryTarget в параметр 'targets' для компонента 'log'

'components' => [
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'flushInterval' => 1,
        'targets' => [
            [
                'class' => luckyshopteam\sentry\SentryTarget::class,
                'exportInterval' => 1,
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:429', // TooManyRequestsHttpException
                    'yii\web\HttpException:401', // UnauthorizedHttpException
                ],
                'userData' => ['id', 'email', 'role'],
            ],
        ]
    ],
],