Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gojob/winston-bugsnag

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gojob/winston-bugsnag

Winston Transporter for Bugsnag. Based on Niftylettuce's work (Nick Baugh).

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
2
Weekly downloads
 
Created
Source

winston-bugsnag-logger

node bugsnag winston license

The maintained and well-documented Bugsnag transport for the winston logger.

Full API documentation is available at: https://docs.bugsnag.com/api/error-reporting/

Index

Install

npm install --save winston winston-bugsnag-logger

Usage

You can configure winston-bugsnag-logger in two different ways.

With new winston.Logger:

const winston = require('winston');
const Bugsnag = require('winston-bugsnag-logger');

const options = {
  apiKey: '*******',
  level: 'info'
};

const logger = new winston.Logger({
  transports: [
    new Bugsnag(options)
  ]
});

Or with winston's add method:

const winston = require('winston');
const Bugsnag = require('winston-bugsnag-logger');

const logger = new winston.Logger();

logger.add(Bugsnag, options);

See Options below for custom configuration.

Options (options)

Per options variable above, here are the default options provided:

Default options:

  • apiKey (String) - your Bugsnag API key (defaults to process.env.BUGSNAG_API_KEY)
  • config (Object) - a Bugsnag configuration object
  • bugsnag (Object) - an optional instance of bugsnag that is already configured via bugsnag.register (if provided this will be used instead of the config option)

Transport related options:

  • name (String) - transport's name (defaults to bugsnag)
  • silent (Boolean) - suppress logging (defaults to false)
  • level (String) - transport's level of messages to log (defaults to info)
  • levelsMap (Object) - log level mapping to Bugsnag (see Log Level Mapping below)

Log Level Mapping

Winston logging levels are mapped by default to Bugsnag's acceptable levels.

These defaults are set as `options.levelsMap' and are:

{
  silly: 'info',
  verbose: 'info',
  info: 'info',
  debug: 'debug',
  warn: 'warning',
  error: 'error'
}

You can customize how log levels are mapped using the levelsMap option:

new Bugsnag({
  levelsMap: {
    verbose: 'info'
  }
});

If no log level mapping was found for the given level passed, then it will not log anything.

License

MIT License

Keywords

FAQs

Package last updated on 22 Feb 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc