0.5.0 • Published 7 years ago

bunyan-raven v0.5.0

Weekly downloads
21
License
BSD-2-Clause
Repository
github
Last release
7 years ago

BUNYAN-RAVEN

BUNYAN-RAVEN is an objectMode stream.Writable implementation that expects node-bunyan log records and sends them to an instance of raven-node.

Basically, this module lets you integrate your existing node-bunyan logs with getsentry.com nice and easy without having to rewrite any code except for where you initialize your node-bunyan logger.

USAGE

First, create your raven-node client as usual:

var raven = require('raven')
  , client = new raven.Client("___YOUR_SENTRY_DSN__OR_DEFER_TO_env.SENTRY_DSN___");

client.patchGlobal(); // optional

Then when you create your node-bunyan logger, include an instance of the RavenStream as well and configure it to match your desired logging level:

var bunyan = require('bunyan')
  , RavenStream = require('bunyan-raven');

var logger = bunyan.createLogger(
  { name: 'test logger'

  // IMPORTANT PART:
  , streams:
    [ { type: 'raw'
      , stream: new RavenStream(client)
      , level: 'error'
      }
    ]
  };

RavenStream will automatically logs any error objects if it is passed in the err key of the log record or will simply creates a new Error object with the log record's message.

SUPPORT / CONTRIBUTE

PRs welcome. Bug reports/assistance, just file a GitHub issue.

LICENSE

BSD-2-clause

0.5.0

7 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.1.1

11 years ago

0.1.0

11 years ago