winston-this
This is a simple winstone logger module to add on your NodeJS project
Install
npm install winston-this
Usage
Create a log instance
const logger = require('winston-this')();
logger.info('Hello');
Create a log instance with a custom tag to identify it
const logger = require('winston-this')('api');
logger.info('Hello');
Tag Usage
You can pass tags to pass more information
logger.info('Hello', { user: 'arielfr' });
Log Levels
To specify a log level you can use the environmental variable LOG_LEVEL.
PROCESS.env.LOG_LEVEL = 'DEBUG';
The default log level is INFO
License
Copyright 2017