Regular cleanup service log,every time the Module service is started
PM2 module to automatically clear logs
$ npm install pm2 -g
$ pm2 install pm2-log-schedule
maxLogs
(Defaults to10
) The maximum number of logs in your server log directorylogPath
(Defaults to/home/web/logs
) Define log path on the serverpattern
(Defaults to\\d{4}-\\d{2}-\\d{2}\\.log
) Log name that needs to be extractedinterval
(Defaults to7
) leaning the cycle of the log
e.g:
pm2 set pm2-log-schedule:interval 10
(Interval 7 days)
$ pm2 uninstall pm2-log-schedule
MIT