pm2-docker splits logs every 65356 bytes with newlines. Breaks JSON output.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with pm2-docker --raw using print_66k_JSON.js and 66k.txt, then inspect the raw-output path handling large console output. Done means the 66k JSON content is emitted as one line without an inserted newline, while normal output behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100