A Custom Logger build on top of Winston.
- Console
- Sentry
- Papertrail
- Rollbar
- Bugsnag
- Isomorphic using raven-js raven-node
npm install winston-transmission
To use winston as is, install this dependency in your project:
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!");
To use sentry, install this dependency in your project:
npm install raven
import winstonTransmission from 'winston-transmission';
global.winston = winstonTransmission({
logLevel: 'info',
processName: 'My Awesome App',
external: {
logLevel: 'warn',
sentry: 'SENTRY-KEY-XXXX',
},
})
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