Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

shiny-es-logger

0.3.1 • Public • Published

node-es-logger v0.3.1

Forked from https://github.com/kt3k/node-es-logger to add custom log function and allow dynamic type override

This module creates a bunyan logger instance with an output stream bound to elasticsearch instance with logstash compatible JSON format.

Example

var logger = require('es-logger').create({
 
    name: 'myapp',
    host: 'localhost:9200'
 
});
 
logger.log(type, {object: value});

This prints a JSON and also send it to elasticsearch instance at localhost:9200.

Use with bonsai.io.

var logger = require('es-logger').create({
 
    name: 'myapp',
    host: 'username:password@myapp-name-123456789.us-west-2.bonsai.io'
 
});
 
logger.info({value: 123}, 'message');

This prints a JSON and also send it to bonsai's elasticsearch instance at myapp-name-123456789.us-west-2.bonsai.io.

see bunyan's README for what interfaces the logger has.

install

npm i shiny-es-logger

Downloadsweekly downloads

2

version

0.3.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability