Add option to flush the logs of all apps
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pm2 flush command and compare its current behavior with pm2 flush <app-name>. The change is done when an --all option clears logs for every app, including the log files under ~/.pm2/logs, and the existing app-specific behavior is clarified or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100