keymetrics / pm2-logrotate

Automatically rotate all applications logs managed by PM2
1.24k stars 138 forks source link
cron easy keymetrics logrotate logrotation logs monitor pm2 rotated

Description

PM2 module to automatically rotate logs of processes managed by PM2.

Install

pm2 install pm2-logrotate

NOTE: the command is pm2 install NOT npm install

Configure

*    *    *    *    *    *
┬    ┬    ┬    ┬    ┬    ┬
│    │    │    │    │    |
│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
│    │    │    │    └───── month (1 - 12)
│    │    │    └────────── day of month (1 - 31)
│    │    └─────────────── hour (0 - 23)
│    └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)

How to view current configuration of the above values ?

After having installed the module, you have to type : pm2 conf

How to set these values ?

After having installed the module you have to type : pm2 set pm2-logrotate:<param> <value>

e.g: