[PR #870] [MERGED] Make the RavenHandler picks the first highest record as main #1389

Closed
opened 2026-03-04 03:11:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/870
Author: @tucksaun
Created: 10/13/2016
Status: Merged
Merged: 11/13/2016
Merged by: @Seldaek

Base: 1.xHead: fix-raven-handler-picking-wrong-event


📝 Commits (1)

  • d234839 Make the RavenHandler picks the first highest record as main

📊 Changes

2 files changed (+27 additions, -1 deletions)

View changed files

📝 src/Monolog/Handler/RavenHandler.php (+1 -1)
📝 tests/Monolog/Handler/RavenHandlerTest.php (+26 -0)

📄 Description

Recently in production, I received a lot of sentry notifications for NotFoundHttpException, which surprised me because we explicitly ignore 404 with a custom activation strategy.
After digging a little bit, I found out that the NotFoundHttpException was not the real reason to send the error to Sentry, but a previous error was, only the RavenHandler was not picking this one.

That lead me to believe that the RavenHandler should pick the first highest log message as the main one, which is the more likely to be the one who "triggered" things in the first place, rest becoming only a resultant of it.
Moreover, this is more consistent with how the MailHandler is behaving (github.com/Seldaek/monolog@58544af7ff/src/Monolog/Handler/MailHandler.php (L59-L69)).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/870 **Author:** [@tucksaun](https://github.com/tucksaun) **Created:** 10/13/2016 **Status:** ✅ Merged **Merged:** 11/13/2016 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `1.x` ← **Head:** `fix-raven-handler-picking-wrong-event` --- ### 📝 Commits (1) - [`d234839`](https://github.com/Seldaek/monolog/commit/d234839de122875fa9db482d469b4c8d9af295de) Make the RavenHandler picks the first highest record as main ### 📊 Changes **2 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Monolog/Handler/RavenHandler.php` (+1 -1) 📝 `tests/Monolog/Handler/RavenHandlerTest.php` (+26 -0) </details> ### 📄 Description Recently in production, I received a lot of sentry notifications for `NotFoundHttpException`, which surprised me because we explicitly ignore 404 with a custom activation strategy. After digging a little bit, I found out that the `NotFoundHttpException` was not the real reason to send the error to Sentry, but a previous error was, only the RavenHandler was not picking this one. That lead me to believe that the `RavenHandler` should pick the first highest log message as the main one, which is the more likely to be the one who "triggered" things in the first place, rest becoming only a resultant of it. Moreover, this is more consistent with how the `MailHandler` is behaving (https://github.com/Seldaek/monolog/blob/58544af7ff9d0c54ef36bc0e4e79330cda751b0e/src/Monolog/Handler/MailHandler.php#L59-L69). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:11:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1389
No description provided.