Skip to content

Commit 53a0cc9

Browse files
committed
fix(imip): group messages by logging principal and uri as context
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent dc48b6b commit 53a0cc9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/private/Calendar/Manager.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ public function handleIMipReply(
403403
}
404404

405405
if (empty($found)) {
406-
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $vEvent->{'UID'}->getValue());
406+
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar', [
407+
'principalUri' => $principalUri,
408+
'eventUid' => $vEvent->{'UID'}->getValue(),
409+
]);
407410
return false;
408411
}
409412

@@ -518,7 +521,10 @@ public function handleIMipCancel(
518521
}
519522

520523
if (empty($found)) {
521-
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $vEvent->{'UID'}->getValue());
524+
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar', [
525+
'principalUri' => $principalUri,
526+
'eventUid' => $vEvent->{'UID'}->getValue(),
527+
]);
522528
return false;
523529
}
524530

tests/lib/Calendar/ManagerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ public function testHandleImipReplyEventNotFound(): void {
10751075
$calendarData->add('METHOD', 'REPLY');
10761076
// construct logger return
10771077
$this->logger->expects(self::once())->method('warning')
1078-
->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
1078+
->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
10791079
// Act
10801080
$result = $manager->handleIMipReply($principalUri, $sender, $recipient, $calendarData->serialize());
10811081
// Assert
@@ -1523,7 +1523,7 @@ public function testHandleImipCancelEventNotFound(): void {
15231523
$calendarData->add('METHOD', 'CANCEL');
15241524
// construct logger return
15251525
$this->logger->expects(self::once())->method('warning')
1526-
->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
1526+
->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
15271527
// Act
15281528
$result = $manager->handleIMipCancel($principalUri, $sender, $replyTo, $recipient, $calendarData->serialize());
15291529
// Assert

0 commit comments

Comments
 (0)