1.0.0 • Published 8 years ago

bunyan-sumologic-strict v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

bunyan-sumologic

SumoLogic stream for the Bunyan logger

Installation

This module assumes you already have bunyan installed

npm install --save bunyan-sumologic

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

OptionDescription
collectorCollector ID for the HTTP collector configured in SumoLogicThis property is required.
endpointSumoLogic HTTP endpoint/region for your appDefault: https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/
syncIntervalHow often logs should be pushed to SumoLogic in millisecondsDefault: 1000
rewriteLevelsWhether Bunyan log levels should be rewritten to be human readable.Changes 30 to INFO, 40 to WARN, etc.Default: true