Skip to content

Instantly share code, notes, and snippets.

@ludovicwyffels
Created September 7, 2019 19:08
Show Gist options
  • Save ludovicwyffels/83041af3c695c6fb4aa5604c95ac77ec to your computer and use it in GitHub Desktop.
Save ludovicwyffels/83041af3c695c6fb4aa5604c95ac77ec to your computer and use it in GitHub Desktop.
// log setup
import winston from 'winston';
const transports = {
console: new winston.transports.Console({ level: 'warn' }),
};
const logger = winston.createLogger({
transports: [transports.console, transports.file]
});
logger.info('This will not be logged in console transport because warn is set!');
transports.console.level = 'info'; // changed the level
logger.info('This will be logged in now!');
export default {logger, transport}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment