From 4fab333f97da384c1def83313877e2666fe0799c Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 10 Feb 2023 13:28:22 +0100 Subject: [PATCH] Updated log messages --- CHANGELOG.md | 2 ++ src/Helper/WebformHelperSF1601.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 188ef9c..94bdad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Updated logging. + ## [1.1.1] ### Changed diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index 5ef7c90..0ce4077 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -188,12 +188,10 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h $type = $handlerMessageSettings[WebformHandlerSF1601::TYPE] ?? SF1601::TYPE_DIGITAL_POST; $response = $service->kombiPostAfsend($transactionId, $type, $message); - $this->notice('Digital post sent to @type @id', $logContext + [ + $this->notice('Digital post sent', $logContext + [ + 'handler_id' => 'os2forms_digital_post', 'operation' => 'digital post sent', - '@type' => $recipientIdentifierType, - '@id' => $recipientIdentifier, - ] - ); + ]); return [$response, $service->getLastKombiMeMoMessage()]; } @@ -245,6 +243,7 @@ public function createJob(WebformSubmissionInterface $webformSubmission, array $ $queue->enqueueJob($job); $context['@queue'] = $queue->id(); $this->notice('Job for sending digital post add to the queue @queue.', $context + [ + 'handler_id' => 'os2forms_digital_post', 'operation' => 'digital post queued for sending', ]); @@ -252,6 +251,7 @@ public function createJob(WebformSubmissionInterface $webformSubmission, array $ } catch (\Exception $exception) { $this->error('Error creating job for sending digital post.', $context + [ + 'handler_id' => 'os2forms_digital_post', 'operation' => 'digital post failed', ]); return NULL;