Skip to content

Instantly share code, notes, and snippets.

@tywong
Created August 24, 2016 02:14
Show Gist options
  • Save tywong/c9bfb62430260705bf2435b362dd46dc to your computer and use it in GitHub Desktop.
Save tywong/c9bfb62430260705bf2435b362dd46dc to your computer and use it in GitHub Desktop.
let LOG_FILE = parseInt((new Date()).getTime() / 1000);
let winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.File, {
"name": "debug-log",
"json": false,
"filename": `log/${LOG_FILE}-debug.log`,
"level": "debug"
});
winston.add(winston.transports.File, {
"name": "info-log",
"json": false,
"filename": `log/${LOG_FILE}-info.log`,
"level": "info"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment