Giter Site home page Giter Site logo

bunyan-raven's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.