pm2 monit previous logs gets cleared when navigating to a different process

Created on 3 Jan 2020  ยท  7Comments  ยท  Source: Unitech/pm2

What's going wrong?

I have 2 nodejs processes running. Both do console logs. When I navigate to a different process, the log box gets cleared and when I navigate back to the previous one, the previous logs are lost.

How could we reproduce this issue?

  1. Run 2 or more nodejs processes that does console logs.
  2. Go to pm2 monit to see the processes.

    • See the 2 processes on the processes box, which is correct.

  3. Notice the process you are currently in, let's call that PROC1. Also notice that PROC1 has logs. Using the arrow keys, navigate to a different process, let's call that PROC2.
  4. (issue 1) The log box will get cleared out and the logs of PROC2 doesn't show.
  5. Using the arrow keys, navigate back to PROC1.
  6. (issue 2) The log box will get cleared out and the logs of PROC1 doesn't show.

issue 1 expected result

Should have displayed all logs of PROC2 (could be limited depending on a particular configuration with reasonable default, like maximum log lines).

issue 2 expected result

Should have displayed all logs of PROC1 (could be limited depending on a particular configuration with reasonable default, like maximum log lines).

Thanks you.

--- PM2 report ----------------------------------------------------------------
Date                 : Fri Jan 03 2020 14:19:25 GMT+0800 (Philippine Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 4.2.1
node version         : 13.5.0
node path            : /usr/local/bin/pm2
argv                 : /usr/local/Cellar/node/13.5.0/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : aprilmintacpineda
uid                  : 501
gid                  : 20
uptime               : 281min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 4.2.1
node version         : 13.5.0
node path            : /usr/local/bin/pm2
argv                 : /usr/local/Cellar/node/13.5.0/bin/node,/usr/local/bin/pm2,report
argv0                : node
user                 : aprilmintacpineda
uid                  : 501
gid                  : 20
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : darwin
type                 : Darwin
cpus                 : Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
cpus nb              : 4
freemem              : 3444666368
totalmem             : 17179869184
home                 : /Users/aprilmintacpineda
===============================================================================
--- PM2 list -----------------------------------------------
โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ id  โ”‚ name                 โ”‚ namespace   โ”‚ version โ”‚ mode    โ”‚ pid      โ”‚ uptime โ”‚ โ†บ    โ”‚ status    โ”‚ cpu      โ”‚ mem      โ”‚ user     โ”‚ watching โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 2   โ”‚ portal-be-cluster    โ”‚ default     โ”‚ N/A     โ”‚ cluster โ”‚ 4475     โ”‚ 4h     โ”‚ 0    โ”‚ online    โ”‚ 0%       โ”‚ 38.4mb   โ”‚ aprโ€ฆ โ”‚ disabled โ”‚
โ”‚ 3   โ”‚ portal-be-cluster    โ”‚ default     โ”‚ N/A     โ”‚ cluster โ”‚ 4476     โ”‚ 4h     โ”‚ 0    โ”‚ online    โ”‚ 0%       โ”‚ 37.3mb   โ”‚ aprโ€ฆ โ”‚ disabled โ”‚
โ”‚ 4   โ”‚ portal-be-cluster    โ”‚ default     โ”‚ N/A     โ”‚ cluster โ”‚ 4477     โ”‚ 4h     โ”‚ 0    โ”‚ online    โ”‚ 0%       โ”‚ 37.6mb   โ”‚ aprโ€ฆ โ”‚ disabled โ”‚
โ”‚ 5   โ”‚ portal-be-cluster    โ”‚ default     โ”‚ N/A     โ”‚ cluster โ”‚ 4478     โ”‚ 4h     โ”‚ 0    โ”‚ online    โ”‚ 0%       โ”‚ 37.1mb   โ”‚ aprโ€ฆ โ”‚ disabled โ”‚
โ”‚ 0   โ”‚ portal-fe            โ”‚ default     โ”‚ N/A     โ”‚ fork    โ”‚ 15555    โ”‚ 26m    โ”‚ 2    โ”‚ online    โ”‚ 0%       โ”‚ 33.5mb   โ”‚ aprโ€ฆ โ”‚ disabled โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
===============================================================================
--- Daemon logs --------------------------------------------
/Users/aprilmintacpineda/.pm2/pm2.log last 20 lines:
PM2        |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
PM2        |     at Object.<anonymous> (/Users/aprilmintacpineda/my-app/node_modules/@babel/node/lib/_babel-node.js:238:23)
PM2        |     at Module._compile (internal/modules/cjs/loader.js:1139:30)
PM2        |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
PM2        |     at Module.load (internal/modules/cjs/loader.js:988:32)
PM2        |     at Function.Module._load (internal/modules/cjs/loader.js:896:14)
PM2        |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
PM2        |     at internal/main/run_main_module.js:17:47
PM2        | Emitted 'error' event on WebSocketServer instance at:
PM2        |     at Server.emit (events.js:305:20)
PM2        |     at emitErrorNT (net.js:1335:8)
PM2        |     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
PM2        |   code: 'EADDRINUSE',
PM2        |   errno: -48,
PM2        |   syscall: 'listen',
PM2        |   address: '::',
PM2        |   port: 7071
PM2        | }
PM2        | [nodemon] app crashed - waiting for file changes before starting...
PM2        | [nodemon] app crashed - waiting for file changes before starting...

Note that those last 20 lines of the daemon logs are not relevant to this issue. Thanks.

stale

Most helpful comment

Don't you dare!

All 7 comments

I don't really get the point of the monit tool with different apps that can be navigated, if each time the log is cleared. If this would work, monit would be such a great tool!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Don't you dare!

Come on! @Unitech

Is this getting a fix?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I don't see the point of logs not persisting while monitoring either. It'd be nice to have an optional config that allows you to persist n number of lines when switching between processes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ldarren picture ldarren  ยท  3Comments

psparago picture psparago  ยท  3Comments

chaos-git picture chaos-git  ยท  3Comments

webchaz picture webchaz  ยท  3Comments

getvega picture getvega  ยท  3Comments