Well, the workaround could be one transport for info.log
Similar:
var logger = new (winston.Logger)({ transports: [ new dailyRotateFile( { //your definition of rotate file }), new (winston.transports.File)({ filename: 'info.log' }) ] });
And then configure some cron to remove info.log at midnight, i.e. node-schedule
However, with this approach, there may be a slight inconsistency, if something is missing after midnight, it can write several lines to info.log, which belongs to the next day, and then is deleted, so info.log may be incomplete.
But all magazines with this info.log.2016-08-09 format remain complete and unaffected.
Therefore, keep in mind that the probability of incomplete info.log for one day is very low. (however, you can create a more advanced check that not only deletes the file, but looks if there is a new day file, and if so, it looks inside and then only removes the logs from previous days from info.log and does not delete them all right away)
libik
source share