Rotate log files automatically using `pm2-logrotate`
- Install this module
pm2 install pm2-logrotate
- Config this module
The following is an example of configuring pm2-logrotate. Other configuration items are similar to being configured. Please check current configuration or pm2 official documentation for detailed configuration items.
pm2 set pm2-logrotate:max_size 100M
- Check whether this module is active
pm2 list
If this module is working you should be able to see its status in the "Module" section.

- Check current configuration of this module
pm2 conf pm2-logrotate

- Check logs of pm2-logrotate
pm2 logs pm2-logrotate
- Reload pm2-logrotate
pm2 reload pm2-logrotate