We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 PM2 官方文档中,提到可以安装 pm2-logrotate 这个库,来实现 PM2 日志的自动切割。
先执行命令 pm2 install pm2-logrotate 安装这个库。
pm2 install pm2-logrotate
然后执行下面的命令,对日志切割的选项进行配置:
# 单个日志文件体积超过 100M 后则自动切割 $ pm2 set pm2-logrotate:max_size 100M # 保存最近 60 天的日志文件,更早的都删除 $ pm2 set pm2-logrotate:retain 60 # 对切割出来的旧日志文件进行 gzip 压缩 $ pm2 set pm2-logrotate:compress true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
解决过程
在 PM2 官方文档中,提到可以安装 pm2-logrotate 这个库,来实现 PM2 日志的自动切割。
先执行命令
pm2 install pm2-logrotate
安装这个库。然后执行下面的命令,对日志切割的选项进行配置:
The text was updated successfully, but these errors were encountered: