Skip to content

Commit 43cc60d

Browse files
authored
fix: spotlight not emitting logs or registering error handlers (#1964)
1 parent dc31502 commit 43cc60d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Integration/IntegrationRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function getDefaultIntegrations(Options $options): array
147147
new ModulesIntegration(),
148148
];
149149

150-
if ($options->getDsn() !== null) {
150+
if ($options->getDsn() !== null || $options->isSpotlightEnabled()) {
151151
array_unshift($integrations, new ExceptionListenerIntegration(), new ErrorListenerIntegration(), new FatalErrorListenerIntegration());
152152
}
153153

src/Transport/HttpTransport.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ private function sendRequestToSpotlight(Event $event): void
171171
return;
172172
}
173173

174+
$eventDescription = \sprintf(
175+
'%s%s [%s]',
176+
$event->getLevel() !== null ? $event->getLevel() . ' ' : '',
177+
(string) $event->getType(),
178+
(string) $event->getId()
179+
);
180+
181+
$this->logger->info(\sprintf('Sending %s to Spotlight.', $eventDescription), ['event' => $event]);
182+
174183
$request = new Request();
175184
$request->setStringBody($this->payloadSerializer->serialize($event));
176185

0 commit comments

Comments
 (0)