How to remove app id and name from pm2 logs?
Asked Answered
S

2

5

Using a pm2.json configuration file, how do I remove id | app.name | prefix in my logs?

My example: 5 | api.bran | part

enter image description here

I went through all pm2 --help and there's no info on how to do it. Is it even possible without editing pm2 module code?

Shangrila answered 22/11, 2017 at 10:5 Comment(0)
P
13

I know this post is old, but i was looking for same options as i have to push the json logs to splunk and this is what i tried .

pm2 logs --raw

Palaeobotany answered 9/5, 2018 at 21:53 Comment(1)
Wow, it does work. I don't know how did I overlook it before, thank you.Shangrila
A
3

In short, NO

If you really need this, you can edit their source according to your need, should be simple enough.

Update: Seems like pm2 now offers --raw flag for this purpose that for versions >= 2.5

Ambiguity answered 29/11, 2017 at 17:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.