🔇 Lower some log level in pusher service

This commit is contained in:
2025-08-14 15:10:41 +08:00
parent 7ec3f25d43
commit b037ecad79
2 changed files with 8 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
return;
}
logger.LogInformation(
logger.LogDebug(
$"Connection established with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}");
try
@@ -66,12 +66,13 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
}
catch (Exception ex)
{
Console.WriteLine($"WebSocket Error: {ex.Message}");
if (ex is not WebSocketException)
logger.LogError(ex, "WebSocket disconnected with user @{UserName}#{UserId} and device #{DeviceId} unexpectedly");
}
finally
{
ws.Disconnect(connectionKey);
logger.LogInformation(
logger.LogDebug(
$"Connection disconnected with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}"
);
}
@@ -114,4 +115,4 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
}
}
}
}
}