@keyrock/winston-bugsnag-transport

0.0.0 • Public • Published

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

/@keyrock/winston-bugsnag-transport/

    Package Sidebar

    Install

    npm i @keyrock/winston-bugsnag-transport

    Weekly Downloads

    6

    Version

    0.0.0

    License

    MIT

    Unpacked Size

    47.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • jfrescokr
    • jdgk
    • keyrock-ninjas