mamatveev/yii2-useful-log-targets

Yii2 log targets: Sentry (Raven_Client) and ElasticSearch

Installs: 3 686

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mamatveev/yii2-useful-log-targets

1.0.4 2023-11-05 11:06 UTC

This package is not auto-updated.

Last update: 2025-09-30 15:27:44 UTC


README

INSTALLATION

composer require mamatveev/yii2-useful-log-targets --dev

Add a component configuration in the application config:

        'log' => [
            'targets' => [
                //sentry log target
                [
                    'class' => 'mamatveev\yii2LogTargets\SentryLogTarget',
                    'levels' => ['error', 'warning'],
                    'dsn' => 'your_sentry_dsn',
                ],
                //elasticSearch log target. connection should be configured 
                [
                    'class' => 'mamatveev\yii2LogTargets\ElasticLogTarget',
                    'levels' => ['info', 'error', 'warning'],
                    'index' => 'oplata-fssp',
                    'type' => 'oplata-fssp-applog',
                    'logVars' => ['_GET', '_POST'],
                    'except' => [
                        'yii\web\HttpException:404',
                        'yii\db\Connection::open',
                    ],
                ]
            ],
        ],