How can I limit the winston log files to a specific number

╄→гoц情女王★ 提交于 2019-12-10 17:53:55

问题


I am thinking of using the log rotation feature of Winston. Is there any way to limit the number of log files. For example if I am rotating files daily, is there a way to specify I want to keep only logs for last three days ?


回答1:


From the comments - @Aleksandr M

maxFiles is that property.

It could read like this:

dailyRotateFile: {
    colorize: false,
    timestamp: true,
    datePattern: '.yyyy-MM-ddTHH-mm',
    filename: filename,
    maxFiles: 5,
    maxsize: 100000000,
    json: false
}


来源:https://stackoverflow.com/questions/33214308/how-can-i-limit-the-winston-log-files-to-a-specific-number

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!