Skip to content

feat: support selective log flushing - #6167

Open
xalonious wants to merge 2 commits into
Unitech:developmentfrom
xalonious:feat/selective-flush
Open

xalonious wants to merge 2 commits into
Unitech:developmentfrom
xalonious:feat/selective-flush

Conversation

@xalonious

Copy link
Copy Markdown
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets None
License AGPL-3.0
Doc PR N/A — README updated

Summary

PM2 already supports selecting stdout and stderr independently with pm2 logs --out and pm2 logs --err. This change adds equivalent stream selection to pm2 flush:

  • pm2 flush <app> --out clears only stdout logs.
  • pm2 flush <app> --err clears only stderr logs.
  • When both flags are supplied, --err takes precedence, matching pm2 logs.

Existing flush commands continue clearing both streams. The programmatic API remains backward-compatible.

Flushing uses existing process log metadata, supporting custom paths, application names, process IDs, and cluster workers. Selecting either stream clears a shared stdout/stderr file.

@CLAassistant

CLAassistant commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants