bunyan-sumologic

SumoLogic stream for the Bunyan logger

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
bunyan-sumologic
411.2.06 years ago7 years agoMinified + gzip package size for bunyan-sumologic in KB

Readme

bunyan-sumologic
npm npm
SumoLogic stream for the Bunyan logger

Usage

const bunyan = require('bunyan');
const SumoLogger = require('bunyan-sumologic');

const sumoConfig = {
    // required config
    collector: 'YOUR SUMOLOGIC COLLECTOR ID',

    // optional config
    endpoint: 'https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/',
    syncInterval: 1000,
    rewriteLevels: true
};

var log = bunyan.createLogger({
    name: 'myapp',
    streams: [
        {
            type: 'raw',
            stream: new SumoLogger(sumoConfig);
        }
    ]
});

log.info('Hello World!');

Configuration Options

|Option|Description| |:---|:---| | collector | Collector ID for the HTTP collector configured in SumoLogic
This property is required. | | endpoint | SumoLogic HTTP endpoint/region for your app
Default: https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/ | | syncInterval | How often logs should be pushed to SumoLogic in milliseconds
Default: 1000 | | rewriteLevels | Whether Bunyan log levels should be rewritten to be human readable.
Changes 30 to INFO, 40 to WARN, etc.
Default: true |

Installation

This module assumes you already have bunyan installed
npm install --save bunyan-sumologic