winston-rollbar2

2.1.4 • Public • Published

winston-rollbar2

Forked from https://github.com/Ideame/winston-rollbar and updated to support latest reporter and maintain longer term.

Thanks also to GorillaStack for previously keeping an updated fork: https://github.com/GorillaStack/winston-rollbar

A rollbar transport for winston.

Installation

  $ npm install winston-rollbar2

Usage

  var winston = require("winston");

  // Requiring `winston-rollbar2` will expose
  // `winston.transports.Rollbar`
  //
  require("winston-rollbar2");

  winston.add(winston.transports.Rollbar, {
    rollbarAccessToken: "API_TOKEN"
    rollbarConfig: {
      environment: "development"
    }
  });

The Rollbar transport uses rollbar.js behind the scenes. Options are the following:

  • rollbarAccessToken: Rollbar post server item access token.
  • rollbarConfig: Rollbar configuration (more info) (optional).
  • level: Level of messages this transport should log. (default: warn).
  • silent: Boolean flag to disable reporting to Rollbar. (default: false).

Requests

To use Rollbar's request logging include the key request with the value of the request object to report.

app.use("/", (req, res) => {
  winston.error("request example", {request: req});
});

Package Sidebar

Install

npm i winston-rollbar2

Weekly Downloads

15

Version

2.1.4

License

MIT

Last publish

Collaborators

  • hipyhop