[GH-ISSUE #1838] LogglyHandler - incorrect records comparison. #784

Closed
opened 2026-03-04 02:17:57 +03:00 by kerem · 2 comments
Owner

Originally created by @dimasvas on GitHub (Sep 20, 2023).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1838

Monolog version 3.4.0

Loggly does not receive all logs. The reason is an incorrect records comparison in LogglyHandler.

Source reference

Now the code is:

return ($record->level >= $level);

It looks like should be:

return ($record->level->value >= $level->value);

We should compare values properties of records.

Originally created by @dimasvas on GitHub (Sep 20, 2023). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1838 Monolog version 3.4.0 Loggly does not receive all logs. The reason is an incorrect records comparison in LogglyHandler. [Source reference](https://github.com/Seldaek/monolog/blob/9546d94bdc212214e23aa7ea5a3734417e33e5e1/src/Monolog/Handler/LogglyHandler.php#L129) Now the code is: `return ($record->level >= $level);` It looks like should be: `return ($record->level->value >= $level->value);` We should compare values properties of records.
kerem 2026-03-04 02:17:57 +03:00
  • closed this issue
  • added the
    Bug
    label
Author
Owner

@omerimzali commented on GitHub (Sep 30, 2023):

Hi @dimasvas, I crated a pr for this one.
https://github.com/Seldaek/monolog/pull/1841

<!-- gh-comment-id:1741749900 --> @omerimzali commented on GitHub (Sep 30, 2023): Hi @dimasvas, I crated a pr for this one. https://github.com/Seldaek/monolog/pull/1841
Author
Owner

@dimasvas commented on GitHub (Oct 2, 2023):

Hi omerimzali! Thank you very much!!!!
I have just decorated the handler and created a temporary kludge until a new version of the monolog package with the fix will be released. Thank you again! Looking forward for new monolog fixes.

<!-- gh-comment-id:1742983821 --> @dimasvas commented on GitHub (Oct 2, 2023): Hi [omerimzali](https://github.com/omerimzali)! Thank you very much!!!! I have just decorated the handler and created a temporary kludge until a new version of the monolog package with the fix will be released. Thank you again! Looking forward for new monolog fixes.
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#784
No description provided.