简体   繁体   中英

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

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 ?

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM