mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[GH-ISSUE #1145] New Relic handler doesn't correctly handle PHP7 Error instances #468
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#468
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 @pauluswebster on GitHub (May 2, 2018).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1145
As per the New Relic (NR) documentation for newrelic_notice_error(), current versions of their PHP Agent support passing instances of PHP7's Throwable to newrelic_notice_error() as well as the long standing support for instances of Exception.
However when monolog's NR handler is handling an error where 'exception' exists in context, it is still explicitly checking this is of class Exception, which will not match any PHP7 Error instances.
@see Monolog/Handler/NewRelicHandler.php
This then results in the fallback usage of newrelic_notice_error() where only the error message is passed to newrelic_notice_error(), which subsequently results in the NR agent compiling the error trace implicitly, including the call stack of the logging itself, rather than taking it explicitly from the Throwable's trace back to the origin of the error.
As per as similar change on the Raven Handler, this should be amended to support instances of Throwable in PHP >= 7. This change related to issue #759, and can be seen applied in PR #834.
I will submit a pull request for this shortly.
@Seldaek commented on GitHub (Jun 17, 2018):
Fixed by https://github.com/Seldaek/monolog/pull/1146