pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

PM2 monit not displaying global logs

Open ernitishkumar opened this issue 7 years ago • 55 comments

What's going wrong?

I am using pm2 3.5 on centos 7.

My node server application requires port 443 to run and because of that I have to run my application by using command

sudo -E pm2 start server.js -i max

When I start pm2 with sudo command the logs or default pm2 folders are created under /root/.pm2/logs/

and because of that sudo pm2 does not shows any logs even when I select individual applications.

How could we reproduce this issue?

Run pm2 with below command

sudo -E pm2 start server.js -i max

then do

sudo pm2 monit

then try to view global logs by selecting app name.

Supporting information

$ pm2 report

ernitishkumar avatar Apr 22 '19 12:04 ernitishkumar

Hello, Since 3.5.0, only the logs of the selected app is shown. You have to select the right process in the top left box

Unitech avatar Apr 23 '19 09:04 Unitech

Hello, Since 3.5.0, only the logs of the selected app is shown. You have to select the right process in the top left box

I have clearly mentioned it in the OP that I have done that still it is not displaying. When I run pm2 without sudo then it displays the logs not when I run it with sudo -E pm2

Kindly read my whole issue first !

ernitishkumar avatar Apr 23 '19 10:04 ernitishkumar

Same issue here with 3.5.1 on macos. No logs are displayed in monit regardless of the process selection in the left pane.

Edit: This was fixed in #4303 but not released. As a workaround I copied the fixed files from that commit and replaced them locally to solve it for now.

edmondburnett avatar Sep 05 '19 01:09 edmondburnett

Same issue with 4.4.0 on Mac. pm2 start ecosystem.json -i 4

Droppix avatar May 17 '20 07:05 Droppix

With 4.5.5 on windows pm2 start server.js -i 4

The logs are only shown when you have selected the specific instance and then the petition comes, but as soon as you switch to another one and back they disappear.

That makes it kind of useless since you can only see live logs if you are in the correct instance of the load balancer and you can't know which instance is going to be used before hand

kikoncuo avatar Mar 18 '21 18:03 kikoncuo

Same issue on 4.5.6

image

NullDev avatar Apr 12 '21 08:04 NullDev

System: WSL Ubuntu 20.04 LTS PM2: version 5.1.2

I am not seeing any logs too, but pm2 logs does show

HaruMiyaGi avatar Feb 23 '22 18:02 HaruMiyaGi

Also not seeing the logs. PM2 version 5.2.0 18.04.1-Ubuntu

Screen Shot 2022-03-02 at 8 45 35 AM

maka-io avatar Mar 02 '22 13:03 maka-io

No logs her either. I'd post screen shots but it looks identical to the above. Can we reopen this for investigation? <3

NotGovernor avatar Mar 05 '22 22:03 NotGovernor

No logs either. Please can we get answer?

stoplion avatar Mar 11 '22 20:03 stoplion

I also don't get logs when calling pm2 monit. But I left the monitor screen open for some time and suddenly some log messages appeared. So it seems only new log messages are displayed after starting pm2 monit, and not old ones.

alex2600 avatar Mar 28 '22 16:03 alex2600

+1, please fix it

  • pm2 monit shows no logs
    • If the application crashes and constantly reloads, errors are displayed in the log window, but during normal operation of the application, the logs are empty
  • pm2 logs app shows logs correctly

PROPHESSOR avatar Mar 28 '22 21:03 PROPHESSOR

This is still an issue

tasdflkjweio avatar May 06 '22 21:05 tasdflkjweio

I can confirm this is still in issue, at least on Windows.

pm2 monit doesnt show any logs:

image

pm2 log shows logs correctly:

image

lucas-labs avatar May 21 '22 09:05 lucas-labs

Still issue for now after upgrading node version. Did everything including re-install pm2.

jooneyp avatar Jun 07 '22 16:06 jooneyp

Same issue, no logs regardless of process selection when using pm2 monit OS: Ubuntu 22.04 Node: 16.15 Pm2: 5.2.0

sourcec0de avatar Jun 13 '22 02:06 sourcec0de

Same issue for me here. pm2 monit doesn't show live logs per instance.

yofisim avatar Jul 29 '22 09:07 yofisim

Same issue on ubuntu server 22.04 pm2 version 5.2.0

DarinDev1000 avatar Jul 30 '22 22:07 DarinDev1000

Same issue on macOS 12.4.1 (M1 mbp) pm2 version 5.2.0

prenaux avatar Sep 12 '22 16:09 prenaux

same, ubuntu 20, pm2 5.2.0

Vandomas avatar Sep 16 '22 06:09 Vandomas