Last active
August 13, 2017 17:39
-
-
Save ofanidariyan/18aa84f6f6cf6815273b59b8440ff1f6 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
const winston = require('winston'); | |
let logger = new winston.Logger({ | |
transports: [ | |
new winston.transports.File({ | |
level: 'verbose', | |
timestamp: new Date(), | |
filename: 'filelog-verbose.log', | |
json: false, | |
}), | |
new winston.transports.File({ | |
level: 'error', | |
timestamp: new Date(), | |
filename: 'filelog-error.log', | |
json: false, | |
}) | |
] | |
}); | |
logger.stream = { | |
write: function(message, encoding) { | |
logger.info(message); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment