hexathos/monolog-elasticsearch-logstashformat

This package is abandoned and no longer maintained. No replacement package was suggested.

Use the logstash formatter with elasticsearch - bugfixed version

1.0.0 2014-06-19 09:02 UTC

This package is not auto-updated.

Last update: 2022-03-05 16:58:26 UTC


README

This handler lets you put logs into Elasticsearch in the Logstash format, which makes visualization with Kibana very easy.

Recommended setup

$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]);

It's a fork.

This repository is a fork of https://github.com/nulpunkt/monolog-elasticsearch-logstashformat.