Improved loggin display
This commit is contained in:
parent
22fcddb050
commit
4c64493bc1
|
|
@ -70,7 +70,6 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Socket</th>
|
||||
<th>Details</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
|
|
@ -78,8 +77,7 @@
|
|||
<tbody>
|
||||
<tr v-for="log in logs.slice().reverse()">
|
||||
<td><span class="badge" :class="getBadgeClass(log)">@{{ log.type }}</span></td>
|
||||
<td>@{{ log.socketId }}</td>
|
||||
<td>@{{ log.details }}</td>
|
||||
<td><pre>@{{ log.details }}</pre></td>
|
||||
<td>@{{ log.time }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -34,68 +34,91 @@ class DashboardLogger
|
|||
$request = $connection->httpRequest;
|
||||
|
||||
static::log($connection->app->id, static::TYPE_CONNECTION, [
|
||||
'details' => "Origin: {$request->getUri()->getScheme()}://{$request->getUri()->getHost()}",
|
||||
'details' => [
|
||||
'origin' => "{$request->getUri()->getScheme()}://{$request->getUri()->getHost()}",
|
||||
'socketId' => $connection->socketId,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function occupied(ConnectionInterface $connection, string $channelName)
|
||||
{
|
||||
static::log($connection->app->id, static::TYPE_OCCUPIED, [
|
||||
'details' => "Channel: {$channelName}",
|
||||
'details' => [
|
||||
'channel' => $channelName,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function subscribed(ConnectionInterface $connection, string $channelName)
|
||||
{
|
||||
static::log($connection->app->id, static::TYPE_SUBSCRIBED, [
|
||||
'details' => [
|
||||
'socketId' => $connection->socketId,
|
||||
'details' => "Channel: {$channelName}",
|
||||
'channel' => $channelName,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function clientMessage(ConnectionInterface $connection, stdClass $payload)
|
||||
{
|
||||
static::log($connection->app->id, static::TYPE_CLIENT_MESSAGE, [
|
||||
'details' => "Channel: {$payload->channel}, Event: {$payload->event}",
|
||||
'details' => [
|
||||
'socketId' => $connection->socketId,
|
||||
'data' => json_encode($payload),
|
||||
'channel' => $payload->channel,
|
||||
'event' => $payload->event,
|
||||
'data' => $payload,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function disconnection(ConnectionInterface $connection)
|
||||
{
|
||||
static::log($connection->app->id, static::TYPE_DISCONNECTION, [
|
||||
'details' => [
|
||||
'socketId' => $connection->socketId,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function vacated(ConnectionInterface $connection, string $channelName)
|
||||
{
|
||||
static::log($connection->app->id, static::TYPE_VACATED, [
|
||||
'details' => "Channel: {$channelName}",
|
||||
'details' => [
|
||||
'socketId' => $connection->socketId,
|
||||
'channel' => $channelName,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function apiMessage($appId, string $channel, string $event, string $payload)
|
||||
{
|
||||
static::log($appId, static::TYPE_API_MESSAGE, [
|
||||
'details' => "Channel: {$channel}, Event: {$event}",
|
||||
'data' => $payload,
|
||||
'details' => [
|
||||
'channel' => $connection,
|
||||
'event' => $event,
|
||||
'payload' => $payload,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function replicatorSubscribed(string $appId, string $channel, string $serverId)
|
||||
{
|
||||
static::log($appId, static::TYPE_REPLICATOR_SUBSCRIBED, [
|
||||
'details' => "Server ID: {$serverId} on Channel: {$channel}",
|
||||
'details' => [
|
||||
'serverId' => $serverId,
|
||||
'channel' => $channel,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function replicatorUnsubscribed(string $appId, string $channel, string $serverId)
|
||||
{
|
||||
static::log($appId, static::TYPE_REPLICATOR_UNSUBSCRIBED, [
|
||||
'details' => "Server ID: {$serverId} on Channel: {$channel}",
|
||||
'details' => [
|
||||
'serverId' => $serverId,
|
||||
'channel' => $channel,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue