mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #219] i can not send a log with PushoverHandler in emergencyLevel #77
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#77
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 @ghanbari on GitHub (Aug 8, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/219
i craete a instane of PushoverHandler
new PushoverHandler('app key, 'user key', $_SERVER['SERVER_NAME'], Logger::ALERT, TRUE, TRUE, Logger::ALERT, Logger::EMERGENCY);
and push this handler with $logger->pushHandler()
now i can sent a alert message with
$logger->addAlert($rawMessage);
but i can not send same message with
$logger->addEmergency($rawMessage);
so, i change https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/PushoverHandler.php#L80
default value: $dataArray['priority'] = 2;
I set $dataArray['priority'] = 1;
have I a mistake think, or that is a bug?
@ghanbari commented on GitHub (Aug 8, 2013):
https://www.pushover.net/api#priority
pushover say that we must set 'priority' & ' expire',
i set those, and i was work very good.
if ($record['level'] >= $this->emergencyLevel) {
$dataArray['priority'] = 2;
}
convert to:
if ($record['level'] >= $this->emergencyLevel) {
$dataArray['priority'] = 2;
$dataArray['retry'] = 100;
$dataArray['expire'] = 100;
}
@Seldaek commented on GitHub (Aug 8, 2013):
Merged your fix, thanks! For next time running the tests would be nice though :)
@ghanbari commented on GitHub (Aug 11, 2013):
no problem, i no learn write a test class(php unit), else i fix it
i have learning it, now.
and very very thanks for your project
sorry if i can not speak english good.