Flush log for a specific app
Open
Nobody has claimed this yet.
S: Open for PR
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
When I run pm2 flush <app_id> or pm2 flush <app_name> pm2 do not flushed the specific logs but indicates that it has been done :
root@vps:/home/node# pm2 flush 2
[PM2] Logs flushed
root@vps:/home/node# pm2 flush appName
[PM2] Flushing:
[PM2] /var/www/dev/logs/out.log
[PM2] /var/www/dev/logs/error.log
[PM2] Logs flushed
If I run pm2 flush it works and clears all logs from all apps.
PM2 report
================================================
--- Daemon -------------------------------------------------
pm2d version : 3.5.1
node version : 8.10.0
node path : not found
argv : /usr/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : root
uid : 0
gid : 0
uptime : 76min
================================================
--- CLI ----------------------------------------------------
local pm2 : 3.5.1
node version : 8.10.0
node path : /usr/local/bin/pm2
argv : /usr/bin/node,/usr/local/bin/pm2,report
argv0 : node
user : root
uid : 0
gid : 0
================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel Core Processor (Haswell, no TSX)
cpus nb : 2
freemem : 6804459520
totalmem : 8165056512
home : /root
================================================
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
Reproduce the reported behavior with pm2 flush 2, pm2 flush appName, and pm2 flush under the PM2 3.5.1 environment described in the report. Trace the CLI handling for app-specific and global flush commands; done means the targeted app logs are cleared without clearing unrelated app logs, while the global command still clears all logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100