How to view pm2 command line arguments passed to Node.js at startup?
Asked Answered
P

1

8

As a server administrator, I would like to view the command line arguments that a Node.js service was started with using pm2. (The ones that Node.js uses via process.argv)

The command pm2 show my-service-name gives information around that service but does not display the command that was used to start it.

e.g. pm2 start index.js -- myProcessArgument

Can anyone please tell me where I can see myProcessArgument, or even better, the full line above?

Pegram answered 24/11, 2016 at 9:8 Comment(0)
G
19

All you have to do is :

pm2 describe <id of application or name>

Example

pm2 describe 1 or pm2 describe app

For Json Output

pm2 jlist

The output should have script args tag that will describe all command line arguments,You can find more information here

Gildea answered 24/11, 2016 at 9:37 Comment(2)
does that show ALL of the command-line args? it looks truncated on my systemTippett
you can try pm2 jlist it should output raw JSON formatGildea

© 2022 - 2024 — McMap. All rights reserved.