jaume
jaume

Reputation: 635

How to do display logs for a few processes in PM2

I know that pm2 logs can be displayed with pm2 logs, while I can specify the same to watch only one process output like pm2 logs myprocess.

Both cases are well described in doc.

I wonder how to select a few of my list or how to output only the ones in an ecosystem file, but I don't see the way.

I tried specifying the ecosystem file, listing the files in command line (separated by comma or space), listing the processes in command line (separated by comma or space), but it didn't work.

Upvotes: 5

Views: 3054

Answers (1)

Cynicade
Cynicade

Reputation: 96

You can use a regex to tail logs for multiple processes. For example:

pm2 logs "/(myprocess|myotherprocess)/"

I couldn't find it in the pm2 documentation anymore to link to it, but here's the PR where they added this feature.

Upvotes: 8

Related Questions