Socket
Socket
Sign inDemoInstall

bunyan-raven

Package Overview
Dependencies
6
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunyan-raven

A bunyan-compatible stream interface that sends error logs to raven-node.


Version published
Weekly downloads
4
decreased by-63.64%
Maintainers
1
Install size
9.79 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 22 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc