diff --git a/modules/acquia_cms_common/src/EventSubscriber/KernelTerminate/AcquiaCmsTelemetry.php b/modules/acquia_cms_common/src/EventSubscriber/KernelTerminate/AcquiaCmsTelemetry.php index 8d93fd87a..30a2b72ad 100644 --- a/modules/acquia_cms_common/src/EventSubscriber/KernelTerminate/AcquiaCmsTelemetry.php +++ b/modules/acquia_cms_common/src/EventSubscriber/KernelTerminate/AcquiaCmsTelemetry.php @@ -178,7 +178,7 @@ private function sendEvent(array $event): void { } /** - * Creates and sends an event to Amplitude. + * Creates and sends an event to Amplitude, Also collects data into sumologic. * * @param string $event_type * The event type. This accepts any string that is not reserved. Reserved @@ -205,7 +205,10 @@ public function sendTelemetry(string $event_type, array $event_properties = []): $this->sendEvent($event); $this->state->set('acquia_cms_common.telemetry.data', json_encode($event_properties)); $this->state->set('acquia_cms_common.telemetry.timestamp', $this->time->getCurrentTime()); - $this->logger->get($event_type)->info(json_encode($event, JSON_PRETTY_PRINT)); + // Logging the database and collecting data into sumologic. + $this->logger->get($event_type)->info('@message', [ + '@message' => json_encode($event['event_properties'], JSON_UNESCAPED_SLASHES), + ]); return TRUE; } diff --git a/modules/acquia_cms_common/tests/src/Kernel/AcquiaCmsTelemetryTest.php b/modules/acquia_cms_common/tests/src/Kernel/AcquiaCmsTelemetryTest.php index d5bfca194..0beb49645 100644 --- a/modules/acquia_cms_common/tests/src/Kernel/AcquiaCmsTelemetryTest.php +++ b/modules/acquia_cms_common/tests/src/Kernel/AcquiaCmsTelemetryTest.php @@ -58,6 +58,7 @@ protected function setUp(): void { $this->container->get("state"), $this->container->getParameter("site.path"), $this->container->get("datetime.time"), + $this->container->get("logger.factory"), ); $path = explode('/', $this->container->getParameter('site.path')); $this->siteUri = end($path); @@ -210,6 +211,7 @@ public function testGetExtensionInfo() { $this->container->get("state"), $this->container->getParameter("site.path"), $this->container->get("datetime.time"), + $this->container->get("logger.factory"), ); $method = $this->getAcqauiaCmsTelemetryMethod("getExtensionInfo"); $actual_data = $method->invoke($telemetry);