Created
September 16, 2015 18:07
-
-
Save breedx2/18831d0e4d71e7f386b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var winston = require('winston'); | |
setInterval(function () { | |
console.log("Making new logger and writing 1 line"); | |
var logger = configure('FHTEST'); | |
logger.info("Any ordinary log message will do"); | |
logger.remove(winston.transports.DailyRotateFile); | |
logger.close(); | |
}, 2000); | |
function configure() { | |
var logger = new winston.Logger({ | |
exitOnError: true | |
}); | |
logger.add(winston.transports.DailyRotateFile, { | |
level: 'info', | |
json: false, | |
filename: './fhtest.log' | |
}); | |
return logger; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment