This commit is contained in:
Marcel Pociot 2018-12-04 17:25:11 +01:00
parent 2eaae22ec0
commit 286629fd98
2 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,9 @@ class ConnectionLogger extends Logger implements ConnectionInterface
public function send($data)
{
$this->info("Connection id {$this->connection->socketId} sending message {$data}");
$socketId = $this->connection->socketId ?? null;
$this->info("Connection id {$socketId} sending message {$data}");
$this->connection->send($data);
}

View File

@ -45,7 +45,9 @@ class WebsocketsLogger extends Logger implements MessageComponentInterface
public function onClose(ConnectionInterface $connection)
{
$this->warn("Connection id {$connection->socketId} closed.");
$socketId = $connection->socketId ?? null;
$this->warn("Connection id {$socketId} closed.");
$this->app->onClose(ConnectionLogger::decorate($connection));
}