Unitech / pm2

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

process.stdout.write doesn't log in same line (with random line breaks) #4026

Open ph55 opened 6 years ago

ph55 commented 6 years ago

What's going wrong?

When using process.stdout.write - output not in the same line. Also the line breaks are random.

How could we reproduce this issue?

// index.js
process.stdout.write('this');
process.stdout.write('should');
process.stdout.write('be');
process.stdout.write('in');
process.stdout.write('one');
process.stdout.write('line');

pm2 start index.js

Output for pm2 logs:

0|index  | this
0|index  | should
0|index  | beinoneline
0|index  | this
0|index  | should
0|index  | beinoneline
0|index  | thisshouldbeinoneline
0|index  | this
0|index  | should
0|index  | bein
0|index  | one
0|index  | line
0|index  | this
0|index  | should
0|index  | beinoneline
0|index  | this
0|index  | shouldbeinone

Supporting information

$ pm2 report

===============================================================================
--- PM2 REPORT (Thu Nov 15 2018 14:01:23 GMT+0200 (Israel Standard Time)) -----
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 3.2.2
node version         : 11.0.0
node path            : /usr/local/bin/pm2
argv                 : /usr/local/Cellar/node/11.0.0/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : sasha
uid                  : 501
gid                  : 20
uptime               : 4min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 3.2.2
node version         : 11.0.0
node path            : /usr/local/bin/pm2
argv                 : /usr/local/Cellar/node/11.0.0/bin/node,/usr/local/bin/pm2,report
argv0                : node
user                 : sasha
uid                  : 501
gid                  : 20
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : darwin
type                 : Darwin
cpus                 : Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
cpus nb              : 4
freemem              : 2403622912
totalmem             : 17179869184
home                 : /Users/sasha
===============================================================================
stale[bot] commented 4 years ago

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.

ph55 commented 4 years ago

@stale bad bot

stale[bot] commented 4 years ago

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.

ph55 commented 4 years ago

@Stale bad bot

sergei202 commented 4 years ago

@ph55: Did you ever find a fix for this? This is definitely a headache for me!

ph55 commented 4 years ago

@sergei202 Nope

stale[bot] commented 4 years ago

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.

ph55 commented 4 years ago

@stale giphy

mindset-tk commented 3 years ago

This issue is still ongoing. Would love a fix.

jamierobertson1 commented 3 years ago

Yes, it would be great if it were fixed.

danschumann commented 2 years ago

Hi, 2022, 06, 03, and I feel unappreciative for wanting a fix on this, because I have no idea what it would entail. Is there a workaround or something, though?

Ah, howabout just tail -f ~/.pm2/logs/yaddayadda-out.log -n 99 ? seems to work

chaitanyabd commented 1 year ago

Hi 2018, welcome to 2022. We have a heritage issue here (far beyond legacy)...

We stopped using pm2 due to this and switched to forever. Honestly I'd love to switch back. Please help.

daron4ever commented 1 year ago

has not updated it yet? we need this update.