如何将 winston 日志文件限制为特定数量
How can I limit the winston log files to a specific number
我正在考虑使用 Winston 的日志轮换功能。有什么办法可以限制日志文件的数量。例如,如果我每天轮换文件,有没有办法指定我只想保留最近三天的日志?
来自评论-@Aleksandr M
maxFiles 就是 属性.
它可以这样读:
dailyRotateFile: {
colorize: false,
timestamp: true,
datePattern: '.yyyy-MM-ddTHH-mm',
filename: filename,
maxFiles: 5,
maxsize: 100000000,
json: false
}
我正在考虑使用 Winston 的日志轮换功能。有什么办法可以限制日志文件的数量。例如,如果我每天轮换文件,有没有办法指定我只想保留最近三天的日志?
来自评论-@Aleksandr M
maxFiles 就是 属性.
它可以这样读:
dailyRotateFile: {
colorize: false,
timestamp: true,
datePattern: '.yyyy-MM-ddTHH-mm',
filename: filename,
maxFiles: 5,
maxsize: 100000000,
json: false
}