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.
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.
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
Try any one of the following commands to clear the logs in pm2,
pm2 flush
pm2 flush appName|appId
© 2022 - 2024 — McMap. All rights reserved.