ennnnny/laravel-es-log
Composer 安装命令:
composer require ennnnny/laravel-es-log
包简介
Elasticsearch logger handler
README 文档
README
Elasticsearch logger for Laravel
Installation
$ composer require ennnnny/laravel-es-log $ php artisan vendor:publish --tag=ennnnny.es_log
Config
You can modify config in config/logger.php.
Now we can add the channel of channels in config/logging.php file.
'channels' => [ 'elastic' => [ 'driver' => 'monolog', 'handler' => \Monolog\Handler\ElasticsearchHandler::class, 'handler_with' => [ 'options' => config('es_log.options'), 'level' => config('es_log.level'), 'bubble' => config('es_log.bubble') ], 'formatter' => \Eslog\Formatter\EslogFormatter::class, ], ],
Now define the environment variable in .env file like this:
LOG_CHANNEL=elastic
ELASTICSEARCH_LOG_LEVEL=200
ELASTICSEARCH_HOST=localhost
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=
Credits
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-02