mamatveev / yii2-useful-log-targets
Yii2 日志目标:Sentry (Raven_Client) 和 ElasticSearch
1.0.4
2023-11-05 11:06 UTC
Requires
- sentry/sentry: ^1.10
- yiisoft/yii2-elasticsearch: ~2.1.0
This package is not auto-updated.
Last update: 2024-09-17 10:40:04 UTC
README
安装
composer require mamatveev/yii2-useful-log-targets --dev
在应用程序配置中添加组件配置
'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', ], ] ], ],