Skip to content

nemtsov/node-bunyan-logentries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bunyan-logentries Build Status

Bunyan logger stream for Logentries.

Installation

First install bunyan:

$ npm install --save bunyan

Then install bunyan-logentries:

$ npm install --save bunyan-logentries

Usage

Note: the stream type must be raw.

var bunyan = require('bunyan');
var bunyanLogentries = require('bunyan-logentries');

var logger = bunyan.createLogger({
  streams: [{
    level: 'info',
    stream: bunyanLogentries.createStream({token: token}),
    type: 'raw'
  }]
});

Advanced Usage

var bunyan = require('bunyan');
var bunyanLogentries = require('bunyan-logentries');

var logger = bunyan.createLogger({
  streams: [{
    level: 'info',
    stream: bunyanLogentries.createStream({ 
      token: token,
      levels: ['debug', 'info', 'notice', 'warning', 'err', 'crit', 'alert', 'emerg'],
      timestamp: false,
      secure: true,
      host:'api.logentries.com'
    }),
    type: 'raw'
  }, {
    transform: function (logRecord) {
      // do whatever you like to the record and then return it
      logRecord.hostname = logRecord.hostname.toUpperCase();
      delete logRecord.v;
      return logRecord
    },
    defaultLevel: 'info'
  }]
});

token should be obtained from Logentries.

License

MIT. See LICENSE

About

Bunyan logger stream for Logentries

Resources

License

Stars

Watchers

Forks

Packages

No packages published