Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Centralizing pm2 logs with elastic search/kibana/logstash

I was wondering if there was a way to centralize pm2 logs by either sending them to elastic search or integrating pm2 with the ELK stack in some way.

like image 709
jman93 Avatar asked Oct 27 '25 06:10

jman93


1 Answers

I would suggest you to use a pm2 module which would send logs to logstash using PM2's pm2.launchBus(errback) api (http://pm2.keymetrics.io/docs/usage/pm2-api/).

As you can see here https://github.com/cliv/pm2-gelf/blob/master/app.js#L24 It's pretty straight forward. The module listens pm2's log events and sends logs using gelf protocol in this case.

like image 168
gkc Avatar answered Oct 28 '25 20:10

gkc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!