Skip to content

fix(logger): prevent concurrent console logs from interleaving - #1763

Open
theolujay wants to merge 1 commit into
cloudflare:masterfrom
theolujay:fix/invalid-concurrent-json-log-lines
Open

theolujay wants to merge 1 commit into
cloudflare:masterfrom
theolujay:fix/invalid-concurrent-json-log-lines

Conversation

@theolujay

Copy link
Copy Markdown

Problem

Concurrent log events can interleave, producing invalid JSON lines.

Change

Buffer each encoded event and write the JSON line in one call. Add regression tests.


Fixes #1761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 --output json writes invalid JSON lines when events are logged concurrently

1 participant