diff --git a/composer.json b/composer.json index c6f2359..c42f139 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": "^8.1", "illuminate/support": "^10.0|^11.0|^12.0", - "rollbar/rollbar": "v4.1.0" + "rollbar/rollbar": "v4.1.1" }, "require-dev": { "orchestra/testbench": "^8.0", diff --git a/src/TelemetryListener.php b/src/TelemetryListener.php index af815bf..bcd312d 100644 --- a/src/TelemetryListener.php +++ b/src/TelemetryListener.php @@ -105,10 +105,10 @@ protected function logMessageHandler(MessageLogged $message): void EventType::Log, // Telemetry does not support all PSR-3 or RFC-5424 levels, so we need to convert them. Telemeter::getLevelFromPsrLevel($message->level), - array_merge( - $message->context, - ['message' => $message->message], - ), + [ + 'message' => $message->message, + 'context' => $message->context, + ], ); } diff --git a/tests/TelemetryListenerTest.php b/tests/TelemetryListenerTest.php index 16bb4aa..4ce6d9d 100644 --- a/tests/TelemetryListenerTest.php +++ b/tests/TelemetryListenerTest.php @@ -49,7 +49,7 @@ public function testTelemetryCapturesLaravelLogs(): void self::assertSame(EventLevel::Debug, $lastItem->level); self::assertSame('telemetry test message', $lastItem->body->message); - self::assertSame(['foo' => 'bar'], $lastItem->body->extra); + self::assertSame(['context' => ['foo' => 'bar']], $lastItem->body->extra); } public function testTelemetryDoesNotCaptureLaravelLogsWhenDisabled(): void