mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #344] JsonFormatter doesn't put new line at end of entry #116
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xiankai on GitHub (Mar 27, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/344
I'm using the JsonFormatter in conjunction with the StreamHandler - but my log file ends up as a single giant line of JSON since I'm only adding one entry at a time and the formatter doesn't add a line break at the end as opposed to the LineFormatter.
Would it make sense to add a line break at the end or would it somehow corrupt handlers that expect strict JSON?
@Seldaek commented on GitHub (Mar 27, 2014):
I don't think it would be a problem no. We already have something to do this for batch formatting, so I think it wouldn't hurt to also do it for the single-record formatting. I don't see what could be affected, but as a safety maybe it could be added as an optional constructor argument so it's possible to disable the newline if needed.
@Seldaek commented on GitHub (Apr 20, 2014):
The JsonFormatter adds a newline by default now