elasticsearch-bunyan-logger

0.1.0 • Public • Published

elasticsearch-bunyan-logger

Build Status Dependency Status Badge

(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 });

Package Sidebar

Install

npm i elasticsearch-bunyan-logger

Weekly Downloads

7

Version

0.1.0

License

MIT

Last publish

Collaborators

  • soplakanets