Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2-docker splits logs every 65356 bytes with newlines. Breaks JSON output. #2613

Open
yangit opened this issue Jan 6, 2017 · 0 comments
Open

Comments

@yangit
Copy link

yangit commented Jan 6, 2017

If we have a script which console.log's 66k json file it will be split with newline at 65536 byte even in pm2-docker --raw mode.

Expected behaviour

pm2-docker --raw print_66k_JSON.js
should only output one line with JSON.

Actual behaviour

Outputs 2 lines split at 65356 bytes.

Steps to reproduce

Create print_66k_JSON.js:

const fs = require('fs')
console.log(fs.readFileSync('./66k.txt', 'utf8'))
setTimeout(() => {}, 1000 * 60 * 60 * 30) // to avoid auto-restart by pm2

Create ./66k.txt file with 66 text in it.
Run pm2-docker --raw print_66k_JSON.js

Observe line break at 65356 byte

Software versions used

OS         : Tried MacOS 10.12.2 and official docker image `node:7.2.0`
node.js    : 6.3.0 or 7.2.0 (tried both)
PM2        : 2.2.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants