pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Add option to flush the logs of all apps

Open nbro10 opened this issue 2 years ago • 0 comments

What's going wrong?

If we do pm2 flush, only the logs at .pm2/pm2.log are flushed (cleared)

Apparently, to flush the logs of an app with need to specify the name, e.g. pm2 flush <app-name>, but if the app name changes, you need to change this command too. Moreover, you would need to do this command for all apps. So, there should be an option to flush the logs of all apps, like pm2 flush --all

Also, in my case, doing pm2 flush my-app does not delete any logs for this app my-app, so this does not work as expected. So, to be clear, after having executed this command, I still have the following files my-app-error.log and my-app-out.log under ~/.pm2/logs. The app is already killed, so pm2 list shows nothing. Not sure if this is the cause of why pm2 flush my-app does not work.

pm2 version = 5.3.0

nbro10 avatar Dec 21 '23 13:12 nbro10