1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00
Commit Graph

41 Commits

Author SHA1 Message Date
Jordi Boggiano
03bbe04ba1 Merge branch '1.x' 2016-06-11 16:09:32 +01:00
Elan Ruusamäe
33df788930 Update NormalizerFormatter.php
^H the i
2016-06-11 16:09:14 +01:00
Jordi Boggiano
21dde4dedb Move to strict mode and fix tests 2016-05-27 13:44:00 +01:00
Jordi Boggiano
f200e79879 CS fixes 2016-05-26 20:54:06 +01:00
Jordi Boggiano
2ff7afda31 Change the way objects are normalized to avoid multi-levels of json encoding, fixes #560 2016-05-26 19:21:47 +01:00
Jordi Boggiano
6f26801be6 More type hints 2016-05-26 18:04:57 +01:00
Jordi Boggiano
76a91c6722 Set default date format to have a timezone, fixes #196 2016-05-26 18:04:51 +01:00
Jordi Boggiano
e27225dc40 Switch to DateTimeImmutable everywhere 2016-05-20 20:55:31 +01:00
Jordi Boggiano
3eee2a006b Merge branch '1.x' 2016-05-20 19:40:36 +01:00
Jordi Boggiano
5ecfbc25de Fix issue in handling of broken iterators when serializing stack frames, fixes #772 2016-05-20 19:39:35 +01:00
Mark Garrett
133a8df5f7 Typo 2016-05-11 11:59:26 -05:00
Mark Garrett
4e4c6d89ac Change out to Throwable 2016-05-11 11:54:35 -05:00
Jordi Boggiano
ba995ffd1e Merge branch '1.x' 2016-03-01 17:15:43 +00:00
Jordi Boggiano
481fc4cfa1 PHP7 compat for exception classes, fixes #718 2016-03-01 16:20:06 +00:00
Jeroen Thora
8ceda1b62e Removed unnecessary php version checks after php dependency bump to 7.0 2015-12-20 15:53:48 +01:00
Jordi Boggiano
7e709c05f6 throwEncodeError does not return, refs #683 2015-11-18 17:57:11 +00:00
Jordi Boggiano
0178fd4f09 CS fixes, refs #683 2015-11-18 17:53:15 +00:00
Jordi Boggiano
9532e979b6 Merge remote-tracking branch 'bd808/feature/clean-json' 2015-11-18 17:50:41 +00:00
Jordi Boggiano
c889fb2648 CS fixes & upgrading cs fixer config 2015-11-18 17:09:46 +00:00
Bryan Davis
6f9e221bd6 Attempt to recover from json encoding errors
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
2015-11-12 10:59:27 -07:00
Anton Sergeyev
f19d9ce9a1 #673 Fix fatal error while normalizing with __toString method which may throw an exception 2015-10-25 22:44:00 +06:00
Henrique Moody
50fb249739 Better normalization for resources 2015-08-20 15:01:24 -03:00
Jordi Boggiano
0c8a92af47 Throw exception when json encoding fails and errors are not ignored, fixes #545 2015-07-12 13:44:48 +01:00
Jordi Boggiano
1a1f506f0e Fix up #546 to json serialize correctly 2015-06-01 21:42:42 +01:00
Dmitrii Raev
57bd24da69 Fix jsonserializable behavior 2015-04-23 23:52:30 +03:00
Dmitrii Raev
ff4d9176d0 Update NormalizerFormatter.php
Some objects implement magic __toString method
Allow to print this kind of objects in the logger
2015-04-22 11:44:08 +03:00
Jordi Boggiano
d434bb4794 Add INF/NaN normalization, fixes #523 2015-03-05 00:57:49 +00:00
Jordi Boggiano
10a3bfa930 Merge pull request #440 from mikesherov/exceptionCodes
Adds exception codes to the exception data in NormalizeFormatter
2014-12-28 16:40:10 +00:00
Thomas Ploch
dca8f5841f Normalize frames for trace items since they can contain invalid data.
Refs https://github.com/Seldaek/monolog/pull/474/files

The fix in the previous PR did not take into account that there might be object wrapped resources that would break json_encode, so the best solution would be normalizing those frames again.

@Seldaek Sorry for the inconvenience, but our graylog is still ramming up with those json_encode error messages.
2014-12-16 13:26:24 +01:00
Jordi Boggiano
7db9d6ef4a Remove reference use, refs #474 2014-12-16 10:23:16 +00:00
Thomas Ploch
00bfec630a Recursively check for resource arguments if trace is coming from internal function.
With `React` or `Guzzle`, that register stream wrappers with PHP, the traces are treated as coming from internal functions with no line and file inside the frame. But they almost always contain resources as arguments, on which the `json_encode()` call will choke (probably this should be addressed in json_encode internally, since it is very easy to cast a resource to a string).

I added a test case proving the situation and a pretty basic recursive checker for resources which just casts them as a string into the frame again.
2014-12-16 10:13:12 +01:00
Mike Sherov
f5fe05c27f Adds exception codes to the exception data in NormalizeFormatter 2014-10-23 15:33:29 -04:00
Jordi Boggiano
0951050a1e Check for json dependency, fixes #378 2014-06-20 16:09:34 +02:00
Gábor Tóth
3a811ecfda fix normalizing exception trace
The trace does not include the file / line at which the exception is thrown
2014-02-06 12:46:03 +01:00
Jordi Boggiano
a43f926ffe Abort normalization of traversables after 1000 items have been discovered, fixes #201 2013-06-07 10:26:36 +02:00
Jordi Boggiano
aa518ad791 Add stack traces to normalized exceptions, closes #192 2013-05-21 21:05:40 +02:00
Jordi Boggiano
63e3bfdf7e Resolve json encoding errors issue globally, refs #137 2013-01-06 20:14:14 +01:00
Jordi Boggiano
4829b09743 Avoid failures when normalizing exotic values, fixes #89 2012-06-15 16:45:26 +02:00
Jordi Boggiano
da33c84d07 CS fixes 2012-06-14 15:47:01 +02:00
Jordi Boggiano
56d246cca3 Make gelf formatter extend the normalizer one 2012-04-22 17:38:31 +02:00
Jordi Boggiano
0bd4d93006 Split off line formatter in normalizer + line formatters 2012-04-22 12:36:23 +02:00