Skip to content

Commit 0da752e

Browse files
committed
Logging
1 parent 8b50a3d commit 0da752e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Driver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function broadcast(array $channels, $event, array $payload = [])
121121

122122
$this->subscriptionRepository->getConnectionIdsForChannels(...$channels)
123123
->reject(fn($connectionId) => $connectionId === $skipConnectionId)
124+
->tap(fn($collection) => logger()->debug("Preparing to send to connections", $collection->toArray()))
124125
->each(fn(string $connectionId) => $this->sendMessage($connectionId, $data));
125126

126127
return;
@@ -139,6 +140,8 @@ public function broadcast(array $channels, $event, array $payload = [])
139140

140141
protected function sendMessage(string $connectionId, string $data): void
141142
{
143+
logger()->debug("Sending message to connection '{$connectionId}'");
144+
142145
try {
143146
$this->connectionRepository->sendMessage($connectionId, $data);
144147
} catch (ApiGatewayManagementApiException $exception) {

0 commit comments

Comments
 (0)