Skip to content

raadad/node-sumologic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-sumologic

A well tested, drop-in replacement for console.log that syncs logs directly to Sumo Logic via their HTTP api (as opposed to using their collectors)

Installation

npm install sumologic

Usage

var SumoLogger = require('sumologic')

// Optional opts
var opts = {
   request // wrapper around https://www.npmjs.com/package/request (useful for testing)
   endpoint // default https://collectors.au.sumologic.com/receiver/v1/http/, change again mostly to aid testing/debugging
   syncInterval // how often we should sync to sumo logic (default ever second)
};

var logger = new SumoLogger('SUMOLOGIC-HTTP-COLLECTOR-CODE' /*, opts */);

// optional - if you would like console.log to go to sumo logic
logger.replaceConsole()

// optional - if you would like console.log to go to sumo logic and stdout
logger.augmentConsole()

logger.log("Yeah, it worked");

About

Sync logs to Sumo Logic via their http API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%