Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.37k stars 2.61k forks source link

Double logging #5517

Open pozirk opened 1 year ago

pozirk commented 1 year ago

Hello.

I'm using pm2 v.5.2.2 After the following command: pm2 start app.js -l mylog.log I have my logs being written twice:

  1. my location: mylog.log
  2. .pm2/logs/ location, out and err are separate

Doing pm2 start app.js -o mylog.log -e mylog.log fixes the problem, but nevertheless. You might want to fix that this double logging.

Thank you.

cbou commented 6 months ago

Same here on 5.3.1

$ node -v
> v18.19.1
$ npm remove -g pm2; npm install -g pm2; pm2 delete all; pm2 start index.js  --attach -i 2
removed 163 packages in 417ms
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 163 packages in 1s

14 packages are looking for funding
  run `npm fund` for details
[PM2] Applying action deleteProcessId on app [all](ids: [ 0, 1 ])
[PM2] [index](0) ✓
[PM2] [index](1) ✓
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App service-bus service-bus service-bus service-bus differs. Type 'pm2 save' to synchronize.
[PM2] Starting /Users/charles/Pidoco/Pixelwerker/Pixelwerker/functions/test/index.js in cluster_mode (2 instances)
[PM2] Done.
┌────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name     │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ index    │ default     │ 1.1.3   │ cluster │ 23909    │ 0s     │ 0    │ online    │ 0%       │ 44.6mb   │ charles  │ disabled │
│ 1  │ index    │ default     │ 1.1.3   │ cluster │ 23910    │ 0s     │ 0    │ online    │ 0%       │ 31.8mb   │ charles  │ disabled │
└────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App service-bus service-bus service-bus service-bus differs. Type 'pm2 save' to synchronize.
[PM2][INFO] Log streaming apps id: 0 1, exit with Ctrl-C or will exit in 10secs
0|index  | hello
1|index  | hello
1|index  | hello