pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

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

Open ph55 opened this issue 6 years ago • 11 comments

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
===============================================================================

ph55 avatar Nov 15 '18 12:11 ph55

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.

stale[bot] avatar May 24 '20 07:05 stale[bot]

@stale bad bot

ph55 avatar May 24 '20 09:05 ph55

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.

stale[bot] avatar Jun 23 '20 09:06 stale[bot]

@Stale bad bot

ph55 avatar Jun 23 '20 11:06 ph55

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

sergei202 avatar Jun 24 '20 15:06 sergei202

@sergei202 Nope

ph55 avatar Jun 25 '20 09:06 ph55

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.

stale[bot] avatar Jul 25 '20 10:07 stale[bot]

@stale giphy

ph55 avatar Jul 25 '20 11:07 ph55

This issue is still ongoing. Would love a fix.

mindset-tk avatar Aug 13 '21 16:08 mindset-tk

Yes, it would be great if it were fixed.

jamierobertson1 avatar Oct 28 '21 20:10 jamierobertson1

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

danschumann avatar Jul 01 '22 04:07 danschumann

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.

chaitanyabd avatar Nov 30 '22 09:11 chaitanyabd

has not updated it yet? we need this update.

daron4ever avatar Oct 15 '23 06:10 daron4ever