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.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i shiny-es-logger

    Weekly Downloads

    0

    Version

    0.3.1

    License

    MIT

    Last publish

    Collaborators

    • shinymayhem