How do I delete/flush pm2 logs for only one app?
It was a bug in pm2.
I submitted an issue and they fixed it.
To solve it on your side, run these commands:
$ npm install pm2@latest -g
$ pm2 update
And it should work with the latest release.
pm2 logs are located in .pm2/logs/
PM2 LOGS COMMANDS :
Show logs
pm2 logs appName|appId --lines=100
Show Error logs
pm2 logs appName|appId --err --lines=100
Empty log for specific app
pm2 flush appName|appId
Empty all log files
pm2 flush
Reload all logs
pm2 reloadLogs
You can flush log of specific app by mentioning name
or id
.
pm2 flush my_app_name // by name
pm2 flush my_app_id // by id