Skip to content

Instantly share code, notes, and snippets.

@ofanidariyan
Last active August 13, 2017 17:39
Show Gist options
  • Save ofanidariyan/18aa84f6f6cf6815273b59b8440ff1f6 to your computer and use it in GitHub Desktop.
Save ofanidariyan/18aa84f6f6cf6815273b59b8440ff1f6 to your computer and use it in GitHub Desktop.
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