Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove app id and name from pm2 logs?

Tags:

json

node.js

pm2

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?

like image 439
wscourge Avatar asked Dec 18 '22 02:12

wscourge


2 Answers

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

like image 100
tomalex Avatar answered Dec 20 '22 17:12

tomalex


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

like image 23
SALEH Avatar answered Dec 20 '22 16:12

SALEH