hexathos / monolog-elasticsearch-logstashformat
此包已被废弃且不再维护。没有建议的替代包。
使用logstash格式化器与Elasticsearch - 已修复版本
1.0.0
2014-06-19 09:02 UTC
Requires
- php: >=5.3.0
- elasticsearch/elasticsearch: ~1.0
- monolog/monolog: 1.*
This package is not auto-updated.
Last update: 2022-03-05 16:58:26 UTC
README
此处理器允许您将日志以Logstash格式放入Elasticsearch,这使得使用Kibana进行可视化非常容易。
推荐设置
$client = new Elasticsearch\Client(['hosts' => ['http://example.com:9200']]); $formatter = new Monolog\Formatter\LogstashFormatter('application', null, null, '', 1); $handler = new Monolog\ElasticLogstashHandler($client, ['type' => 'invoicing-logs']); $handler->setFormatter($formatter); $log = new Monolog\Logger('invoicing'); $log->pushHandler($handler); $log->warn('new sale', ['user_id' => 42, 'product_id' => 7537]);
这是一个分支。
此仓库是https://github.com/nulpunkt/monolog-elasticsearch-logstashformat的分支。