🔇 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; return;
} }
logger.LogInformation( logger.LogDebug(
$"Connection established with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}"); $"Connection established with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}");
try try
@@ -66,12 +66,13 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
} }
catch (Exception ex) 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 finally
{ {
ws.Disconnect(connectionKey); ws.Disconnect(connectionKey);
logger.LogInformation( logger.LogDebug(
$"Connection disconnected with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}" $"Connection disconnected with user @{currentUser.Name}#{currentUser.Id} and device #{deviceId}"
); );
} }

View File

@@ -304,6 +304,6 @@ public class PushService
} }
_logger.LogInformation( _logger.LogInformation(
$"Successfully pushed notification #{notification.Id} to device {subscription.DeviceId}"); $"Successfully pushed notification #{notification.Id} to device {subscription.DeviceId} provider {subscription.Provider}");
} }
} }