Closed shadow0162 closed 9 years ago
We should add .setEncoding('utf8');
on all log streams
https://github.com/Unitech/PM2/blob/master/lib/ProcessContainer.js#L110
@soyuka ?
Nope it is utf8
by default.
I'll check this but I don't think it's encoding relative.
Are you getting these from pm2-interface events? Or is this from the log stream file?
I could not reproduce this.
After this command exec , out log can get the error.(system on ubuntu 12.04_64 & node 0.10.0)
root@5Z:pm2 start GambleServer/index.js
{ online: true, success: true, pid: 30823, pm2_version: '0.9.4' }
PM2 Process launched
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │
watching │
│ index │ 0 │ cluster │ 30831 │ online │ 0 │ 0s │ 15.941 MB │ u
nactivated │
Use pm2 desc[ribe] <id>
to get more details
root@5Z:/projects/BoardGames#
undefined:1
{"type":"log:out","data":"h?f%16006\n"}
^
SyntaxError: Unexpected token
at Object.parse (native)
at Pipe.channel.onread (child_process.js:335:28)
Sorry for late. i already passed the bug by updated node version(0.10.0 to 0.10.28).And then it never happen again.
i got this error after start process.
undefined:1 {"type":"log:out","data":"g,web8005g+/e#f*g%\n"} ^ SyntaxError: Unexpected token t Object.parse (native) at Pipe.channel.onread (child_process.js:335:28)
The code is "console.log('监听'+'web8005');
what should i do?