mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #1736] NormalizerFormatter skips some stacktraces #730
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#730
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 @WoZ on GitHub (Jul 19, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1736
Monolog version 2|3
Check the function.
github.com/Seldaek/monolog@5579edf28a/src/Monolog/Formatter/NormalizerFormatter.php (L230-L235)PHP Fatal Error caught by
register_shutdown_function()hastracefield. Inside thistracefield there can be few elements withoutfileandlinefields.Here is an example:
Run this script and you will see the following output of the
$e->getTrace()method:You may change
register(false)toregister(true)and check the results:All that records without
fileandlinewill be skipped and engineer can't understand the full picture.If you agree with this I may provide PR.
@Seldaek commented on GitHub (Jul 22, 2022):
I would rather not change the format, right now it normalizes to an array of file/line arrays. If you think you can fix it without changing the data type then please send a PR (or tell me how if you'd rather discuss first).
@WoZ commented on GitHub (Jul 23, 2022):
@Seldaek I agree with you in general. I've found that sentry does the following with such errors.
So, we may assume that someone parses an array for file/line string elements. The only option is to use a semicolon as a delimiter. So, the option is to mimic this format not to break compatibility.
Option 1.
[internal]:0, as sentry doesOption 2.
internal[shutdownFunction]:0andinternal[ErrorHandler][shutdownMethod]:0Option 3.
internal(shutdownFunction):0andinternal[ErrorHandler](shutdownMethod):0P.S. I missed to attach my test.php script.
@Seldaek commented on GitHub (Jul 23, 2022):
Id maybe do this as option 4 for methods but otherwise yes I like this idea:
@WoZ commented on GitHub (Jul 23, 2022):
For me ErrorHandler->methodName may be confusing if this is static method.
ErrorHandler.methodName is less confusing imho.
On Sat, Jul 23, 2022, 09:52 Jordi Boggiano @.***> wrote:
@Seldaek commented on GitHub (Jul 23, 2022):
Sure, the point was just to avoid
::)