elasticsearch-bunyan-logger
v0.1.0
Published
A bunyan logger for ElasticSearch client.
Downloads
15
Maintainers
Readme
elasticsearch-bunyan-logger
(Bunyan)[https://github.com/trentm/node-bunyan] logging adapter for elasticsearch-js. A convenience library that uses default implementation from ElasticSearch lib docs.
Usage
var bunyanLogger = require('elasticsearch-bunyan-logger');
var elasticsearch = require('elasticsearch');
var BunyanLogger = bunyanLogger();
var client = new elasticsearch.Client({ log: BunyanLogger });
You may also pass a configured bunyan Instance
var bunyan = require('bunyan')
var bunyanLogger = require('elasticsearch-bunyan-logger');
var elasticsearch = require('elasticsearch');
var logger = bunyan.createLogger({name: 'my-elasticsearch-logger', level: 'error'});
var BunyanLogger = bunyanLogger(logger);
var client = new elasticsearch.Client({ log: BunyanLogger });