diff --git a/src/Integration/IntegrationRegistry.php b/src/Integration/IntegrationRegistry.php index be2df22eb..e07926645 100644 --- a/src/Integration/IntegrationRegistry.php +++ b/src/Integration/IntegrationRegistry.php @@ -147,7 +147,7 @@ private function getDefaultIntegrations(Options $options): array new ModulesIntegration(), ]; - if ($options->getDsn() !== null) { + if ($options->getDsn() !== null || $options->isSpotlightEnabled()) { array_unshift($integrations, new ExceptionListenerIntegration(), new ErrorListenerIntegration(), new FatalErrorListenerIntegration()); } diff --git a/src/Transport/HttpTransport.php b/src/Transport/HttpTransport.php index f47867fe8..f9eb77621 100644 --- a/src/Transport/HttpTransport.php +++ b/src/Transport/HttpTransport.php @@ -157,6 +157,15 @@ private function sendRequestToSpotlight(Event $event): void return; } + $eventDescription = \sprintf( + '%s%s [%s]', + $event->getLevel() !== null ? $event->getLevel() . ' ' : '', + (string) $event->getType(), + (string) $event->getId() + ); + + $this->logger->info(\sprintf('Sending %s to Spotlight.', $eventDescription), ['event' => $event]); + $request = new Request(); $request->setStringBody($this->payloadSerializer->serialize($event));