node.js - Winston: how to rotate logs -


How can I move the log when using Winston to handle logging for a node That's it, how do I create a new file for every day I run the app?

  var logger = new (Winston.logger) ({transports: [new (winston.transports.Console) (), new (winston.transports.File) ({filename: '2012- 07-09.log '})]}); Logger.log ('info', 'test log message', {anything: 'this is metadata'});    

Winston author and maintainer here

Accessing a new file every day is currently open feature request: It would be nice to see someone implementing it.

He said, there are other options:

  1. File transport accepts a maximum option that will rotate the logfile when it exceeds a certain size in bytes is.

  2. There is an open bridge request with a new transport, I do not really have the opportunity to dig in "filrootate", which it seems like this date -based rotation:

Comments