airani/yii2-elasticsearch-log
最新稳定版本:v1.0.1
Composer 安装命令:
composer require airani/yii2-elasticsearch-log
包简介
Yii 2.0 Elasticsearch log target
关键字:
README 文档
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require -vv --prefer-dist airani/yii2-elasticsearch-log
or add below line to the composer.json and run php composer.phar update -vv --prefer-dist --profile
"airani/yii2-elasticsearch-log": "~1.0"
Usage
Config elasticsearch log target in config file like below code. with set extraFields property in log target config you can set more extra fields to log results.
'components' => [ // ... 'log' => [ 'targets' => [ [ 'class' => 'airani\log\ElasticsearchTarget', 'levels' => ['error', 'warning'], 'index' => 'yii', 'type' => 'log', 'db' => 'elasticsearch', 'extraFields' => [ 'ip' => function ($app) { return $app->request->getUserIP(); } ] ], ], ], ],
统计信息
- 总下载量: 11.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-10-13