pm2
pm2 copied to clipboard
process.stdout.write doesn't log in same line (with random line breaks)
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
===============================================================================
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 bad bot
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 bad bot
@ph55: Did you ever find a fix for this? This is definitely a headache for me!
@sergei202 Nope
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

This issue is still ongoing. Would love a fix.
Yes, it would be great if it were fixed.
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
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.
has not updated it yet? we need this update.