pm2-gui message can be classified according to different app to display it?
pm2-gui message can be classified according to different app to display it? for example now i have two apps, pm2-redis and pm2-mongodb, the pm2-gui display message as follow 2017-11-24 18:28:09: App [pm2-redis] with id [0] and pid [101116], exited with code [0] via signal [SIGINT] 2017-11-24 18:28:10: App [pm2-mongodb] with id [1] and pid [101975], exited with code [0] via signal [SIGINT]
Can pm2-gui display App [pm2-redis] message when i select pm2-redis and display App [pm2-mongodb] messagewhen i select pm2-mongodb? or what can i do? thank you!
gotcha, the logs actually from pm2.log but not the [app].log.
its a good idea to grep logs by app name from pm2.log and do not display others
what should i do?thank you
in terminal, use commnd ‘tail -f /root/.pm2/pm2.log | grep --line-buffered "pm2-redis"’ ,i can get the log info by app name but how to modify the source 'pm._tailLogs = function (proc, cb) { ' in the file /lib/pm2.js , now: var tail = spawn('tail', ['-n', 20, '-f'].concat(logFiles), { killSignal: 'SIGTERM', detached: true, stdio: ['ignore', 'pipe', 'pipe'] })
modify: var tail = spawn('tail', ['-n', 20, '-f'].concat(logFiles), { killSignal: 'SIGTERM', detached: true, stdio: ['ignore', 'pipe', 'pipe'] }) var grep = spawn('grep', ['--line-buffered'].concat(# appname), { killSignal: 'SIGTERM', detached: true, stdio: [tail.stdout, 'pipe', 'pipe'] })
but how can i get the app name
Thank you!