Skip to content

GorillaStack/winston-rollbar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-transport-rollbar Build Status

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

A rollbar transport for winston.

Installation

  $ npm install winston
  $ npm install winston-transport-rollbar

ES6 usage

import winston from 'winston';
import { Rollbar } from 'winston-transport-rollbar';

winston.add(winston.transports.Rollbar, options);
// or
const logger = new winston.Logger({ transports: [new Rollbar({
    rollbarConfig: {
      accessToken: serverAccessToken,
      environment: environment,
      reportLevel: reportLevel,
    },
  })]
});

ES5 usage

var winston = require('winston');

//
// Requiring `winston-rollbar` will expose
// `winston.transports.Rollbar`
//
require('winston-transport-rollbar').Rollbar;

winston.add(winston.transports.Rollbar, options);

Options

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

  • rollbarConfig: Rollbar configuration (more info) (mandatory, must contain rollbarAccessToken)
  • metadataAsRequest: Uses metadata object as Rollbar's request parameter. (default: false will send for meta.req if provided)
  • level: Level of messages this transport should log. (default: warn).
  • silent: Boolean flag indicating whether to suppress output (default: false).

About

A rollbar transport for winston

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%