PM2 monit not displaying global logs
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
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
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 !
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.
Same issue with 4.4.0 on Mac. pm2 start ecosystem.json -i 4
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
Same issue on 4.5.6

System: WSL Ubuntu 20.04 LTS PM2: version 5.1.2
I am not seeing any logs too, but pm2 logs does show
Also not seeing the logs. PM2 version 5.2.0 18.04.1-Ubuntu

No logs her either. I'd post screen shots but it looks identical to the above. Can we reopen this for investigation? <3
No logs either. Please can we get answer?
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.
+1, please fix it
pm2 monitshows 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 appshows logs correctly
This is still an issue
I can confirm this is still in issue, at least on Windows.
pm2 monit doesnt show any logs:

pm2 log shows logs correctly:

Still issue for now after upgrading node version. Did everything including re-install pm2.
Same issue, no logs regardless of process selection when using pm2 monit
OS: Ubuntu 22.04
Node: 16.15
Pm2: 5.2.0
Same issue for me here. pm2 monit doesn't show live logs per instance.
Same issue on ubuntu server 22.04 pm2 version 5.2.0
Same issue on macOS 12.4.1 (M1 mbp) pm2 version 5.2.0
same, ubuntu 20, pm2 5.2.0