/winston-transmission

Winston Transmission: a logger built on top of winston

Primary LanguageJavaScriptMIT LicenseMIT

Winston Transmission

npm version

A Custom Logger build on top of Winston.

  • Console
  • Sentry
  • Papertrail
  • Rollbar
  • Bugsnag
  • Isomorphic using raven-js raven-node
npm install winston-transmission

Usage and Configs

To use winston as is, install this dependency in your project:

Basic

The basic configurations only reports to the console, the default logging level is info.

import winstonTransmission from 'winston-transmission';

const logger = winstonTransmission({
  logLevel: 'info',
});

logger.info("Hello World!");

Sentry

To use sentry, install this dependency in your project:

npm install raven

Usage

import winstonTransmission from 'winston-transmission';

global.winston = winstonTransmission({
  logLevel: 'info',
  processName: 'My Awesome App',
  external: {
    logLevel: 'warn',
    sentry: 'SENTRY-KEY-XXXX',
  },
})

npm log-levels Assumption

Winston Transmission assumes npm log-levels, and bases its logging upon it.

Each level is given a specific integer priority. The higher the priority the more important the message is considered to be. Ordered from highest priority to the lowest:

error | warn | info | verbose | debug | silly