Bunyan Sentry Stream
Write log to Sentry/Raven by using Bunyan
Install & Use
npm i --save
How to :
const raven = require('raven');
const bunyan = require('bunyan');
const sentryStream = require('bunyan-sentry-stream');
const client = new raven.Client(process.env.SENTRY_DSN, { });
const simpleLogger = bunyan.createLogger({
name: 'logger',
streams: [
{
level: 'debug',
stream: process.stdout
},
sentryStream(client)
]
});
const SentryStream = require('bunyan-sentry-stream').SentryStream;
const advancedLogger = bunyan.createLogger({
name: 'logger',
streams: [
{
level: 'debug',
type: 'raw',
stream: new SentryStream(client)
}
]
});
Contribute
npm test
npm run coverage
npm run lint
npm run mocha