Unitech / Unitech/pm2

Normal logs are displayed as errors.

Open
#5,513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

Normal logs are displayed as errors.

How could we reproduce this issue?

Python 3.11, use Logging and colorlog.

Supporting information

root@melody-newyork:~# pm2 report

--- PM2 report ----------------------------------------------------------------
Date                 : Sat Dec 31 2022 08:00:21 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.2.2
node version         : 10.19.0
node path            : /usr/local/bin/pm2
argv                 : /usr/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : root
uid                  : 0
gid                  : 0
uptime               : 3987min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.2.2
node version         : 10.19.0
node path            : /usr/local/bin/pm2
argv                 : /usr/bin/node,/usr/local/bin/pm2,report
argv0                : node
user                 : root
uid                  : 0
gid                  : 0
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : DO-Premium-AMD
cpus nb              : 2
freemem              : 153186304
totalmem             : 4122697728
home                 : /root
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬───────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name              │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1   │ Melody Shard 0    │ default     │ N/A     │ fork    │ 722323   │ 2D     │ 0    │ online    │ 0%       │ 70.5mb   │ root     │ disabled │
│ 2   │ Melody Shard 1    │ default     │ N/A     │ fork    │ 722324   │ 2D     │ 0    │ online    │ 0%       │ 70.5mb   │ root     │ disabled │
└─────┴───────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/root/.pm2/pm2.log last 20 lines:
PM2        | 2022-12-28T13:59:38: PM2 log: App [run:0] online
PM2        | 2022-12-28T13:59:42: PM2 log: Stopping app:run id:0
PM2        | 2022-12-28T13:59:43: PM2 log: pid=722211 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T13:59:43: PM2 log: pid=722211 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T13:59:43: PM2 log: App [run:0] exited with code [0] via signal [SIGINT]
PM2        | 2022-12-28T13:59:43: PM2 log: pid=722211 msg=process killed
PM2        | 2022-12-28T14:02:28: PM2 log: App [run:0] starting in -fork mode-
PM2        | 2022-12-28T14:02:29: PM2 log: App [run:0] online
PM2        | 2022-12-28T14:10:29: PM2 log: App [Melody Shard 0:1] starting in -fork mode-
PM2        | 2022-12-28T14:10:29: PM2 log: App [Melody Shard 1:2] starting in -fork mode-
PM2        | 2022-12-28T14:10:29: PM2 log: App [Melody Shard 0:1] online
PM2        | 2022-12-28T14:10:29: PM2 log: App [Melody Shard 1:2] online
PM2        | 2022-12-28T14:10:42: PM2 log: Stopping app:run id:0
PM2        | 2022-12-28T14:10:42: PM2 log: pid=722247 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T14:10:43: PM2 log: pid=722247 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T14:10:43: PM2 log: pid=722247 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T14:10:43: PM2 log: pid=722247 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T14:10:43: PM2 log: pid=722247 msg=failed to kill - retrying in 100ms
PM2        | 2022-12-28T14:10:43: PM2 log: App [run:0] exited with code [0] via signal [SIGINT]
PM2        | 2022-12-28T14:10:43: PM2 log: pid=722247 msg=process killed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with Python 3.11, Logging, and colorlog under PM2, then compare how normal and error output is classified. The issue names no source file, entry point, or test, so first trace the PM2 log-handling path from the reported command-line setup. Done means normal logs are no longer displayed as errors and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, python
Domain
cli, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.