mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #1184] Question: why the LineFormatter doesn't try to recover json encoding errors? #488
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#488
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 @mmenozzi on GitHub (Aug 4, 2018).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1184
Like stated in the subject: why the LineFormatter doesn't try to recover json encoding errors?
I mean something that has already been done with https://github.com/Seldaek/monolog/pull/683 for the NormalizerFormatter.
Is simply because anyone didn't have time to do such implementation or there are other reasons?
@Seldaek commented on GitHub (Nov 4, 2018):
I think it's mostly because nobody did it yes.. Feel free to PR
@mmenozzi commented on GitHub (Nov 4, 2018):
Ok I’ll do it
@mmenozzi commented on GitHub (Nov 5, 2018):
Hi @Seldaek ,
sorry but what I said before it's not correct.
The
NormalizerFormattercontains the logic to try to recover from json encoding errors but this logic isn't used in theNormalizerFormatteritself.That logic is called from the
NormalizerFormatter::toJsonmethod but only if the$ignoreErrorsparameters isfalse. Inside theNormalizerFormatterthetoJsonmethod is always called with$ignoreErrorsset totrue.I found that the
NormalizerFormatter::toJsonmethod with$ignoreErrorsset tofalseis called only in theGelfMessageFormatter,LogstashFormattersandWildfireFormatterformatters.So the question now is: what we would like to do? Should the
LineFormatter(or maybe also others) tries to recover json encoding errors or not?@Seldaek commented on GitHub (Nov 19, 2018):
Hmm I guess maybe yes. I think the whole formatter thing needs to be cleaned up in 2.0 but it's a rather complex task :/