Can I flush the logs of only one app in Pm2?
Assuming my app id is 2
I tried
pm2 flush 2
but still it flushes all apps' logs.
pm2/pm2. log file that quickly caught up in size after the initial delete. If you want you can reboot after flushing pm2 logs. This method fixed the issue of the file still taking up space because it was used by all those processes.
Access the logs By default, all logs are saved into $HOME/. pm2/logs .
Type pm2 log in a shell and you get an overview of the last 15 log lines and the last 15 error lines in realtime. At the top of these log lines, the location of your logfile is shown. You can also type pm2 log --lines 1000 to show more lines, in this case 1000. Show activity on this post.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With