@keyrock/winston-bugsnag-transport

Bugsnag transport for winston ^3.0.0

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@keyrock/winston-bugsnag-transport
000.0.04 years ago4 years agoMinified + gzip package size for @keyrock/winston-bugsnag-transport in KB

Readme

winston-bugsnag-transport
winston transport for Bugsnag. Sends all messages with level error to Bugsnag.

Usage

First, you'll need to install the package with yarn or npm:
yarn add @keyrock/winston-bugsnag-transport

or
npm install --save @keyrock/winston-bugsnag-transport

Then, when instantiating winston:
const winston = require("winston");
const bugsnag = require("bugsnag");
const BugsnagTransport = require("@keyrock/winston-bugsnag-transport");

// You need to properly initialize your bugsnag instance. Refer to the documentation.
bugsnag.register("your api key");

// ...

const logger = winston.createLogger({
  level: "debug",
  transports: [
    new BugsnagTransport({
      bugsnag: bugsnag // Your Busgnag instance
    })
    // ... your other transports
  ]
});

Note that the initialization of the Bugnsag library should be done before initializing Winston.

License

MIT