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

Question: why the LineFormatter doesn't try to recover json encoding errors? #1184

Closed
mmenozzi opened this issue Aug 4, 2018 · 4 comments
Closed
Labels
Milestone

Comments

@mmenozzi
Copy link

mmenozzi commented Aug 4, 2018

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 #683 for the NormalizerFormatter.

Is simply because anyone didn't have time to do such implementation or there are other reasons?

@Seldaek
Copy link
Owner

Seldaek commented Nov 4, 2018

I think it's mostly because nobody did it yes.. Feel free to PR

@Seldaek Seldaek added the Feature label Nov 4, 2018
@mmenozzi
Copy link
Author

mmenozzi commented Nov 4, 2018

Ok I’ll do it

@mmenozzi
Copy link
Author

mmenozzi commented Nov 5, 2018

Hi @Seldaek ,
sorry but what I said before it's not correct.

The NormalizerFormatter contains the logic to try to recover from json encoding errors but this logic isn't used in the NormalizerFormatter itself.

That logic is called from the NormalizerFormatter::toJson method but only if the $ignoreErrors parameters is false. Inside the NormalizerFormatter the toJson method is always called with $ignoreErrors set to true.

I found that the NormalizerFormatter::toJson method with $ignoreErrors set to false is called only in the GelfMessageFormatter, LogstashFormatters and WildfireFormatter formatters.

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 Seldaek added this to the 2.0 milestone Nov 19, 2018
@Seldaek
Copy link
Owner

Seldaek commented 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 :/

@Seldaek Seldaek modified the milestones: 2.0, 2.x Jul 6, 2019
@Seldaek Seldaek closed this as completed May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants