• 安装 pm2-logrotate github地址 https://github.com/keymetrics/pm2-logrotate#configure
pm2 install pm2-logrotate
• 这里我们设置,当日志文件数量超过50个时候,就自动删除旧文件
pm2 set pm2-logrotate:retain 50
• 查看详细配置
pm2 conf pm2-logrotate
本文介绍了如何通过PM2的pm2-logrotate模块来自动管理日志文件。首先,从GitHub安装pm2-logrotate,然后设置当日志文件超过50个时自动删除旧文件,最后查看详细的配置信息,确保日志维护的高效和整洁。
• 安装 pm2-logrotate github地址 https://github.com/keymetrics/pm2-logrotate#configure
pm2 install pm2-logrotate
• 这里我们设置,当日志文件数量超过50个时候,就自动删除旧文件
pm2 set pm2-logrotate:retain 50
• 查看详细配置
pm2 conf pm2-logrotate
2740

被折叠的 条评论
为什么被折叠?