mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[PR #683] [MERGED] Attempt to recover from json encoding errors #1296
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#1296
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?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/683
Author: @bd808
Created: 11/12/2015
Status: ✅ Merged
Merged: 11/18/2015
Merged by: @Seldaek
Base:
master← Head:feature/clean-json📝 Commits (1)
6f9e221Attempt to recover from json encoding errors📊 Changes
3 files changed (+225 additions, -10 deletions)
View changed files
📝
src/Monolog/Formatter/NormalizerFormatter.php(+90 -7)📝
tests/Monolog/Formatter/LogstashFormatterTest.php(+43 -0)📝
tests/Monolog/Formatter/NormalizerFormatterTest.php(+92 -3)📄 Description
Detect and attempt to recover from json_encode errors triggered by
strings containing invalid UTF-8 sequences. Recovery will only be
attempted when encoding strings or arrays. If recovery fails then
a RuntimeException will be thrown.
The recovery process will convert invalid UTF-8 codepoints as though the
input string was encoded using the ISO-8859-15 character encoding. This
conversion may result in incorrect string output if the original
encoding was not ISO-8859-15, but it will be a valid UTF-8 string.
Closes #545 and possibly #616
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.