Setup log rotate for PM2 - ChuanyuWang/test GitHub Wiki
Install pm2 plugin pm2-rotate with user jenkins
(the same user running pm2 command)
pm2 install pm2-logrotate
Available configuration refer to https://github.com/keymetrics/pm2-logrotate#configure
Change daily (default setting) log rotate to yearly
pm2 set pm2-logrotate:rotateInterval '0 0 12 1 1 ? *'