diff --git a/DysonNetwork.Pusher/Connection/WebSocketController.cs b/DysonNetwork.Pusher/Connection/WebSocketController.cs index 5db6cf8..0f0c0c5 100644 --- a/DysonNetwork.Pusher/Connection/WebSocketController.cs +++ b/DysonNetwork.Pusher/Connection/WebSocketController.cs @@ -57,7 +57,7 @@ public class WebSocketController(WebSocketService ws, ILogger 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 } 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 } } } -} \ No newline at end of file +} diff --git a/DysonNetwork.Pusher/Notification/PushService.cs b/DysonNetwork.Pusher/Notification/PushService.cs index 03db303..e546ad8 100644 --- a/DysonNetwork.Pusher/Notification/PushService.cs +++ b/DysonNetwork.Pusher/Notification/PushService.cs @@ -191,7 +191,7 @@ public class PushService }).ToList(); await _db.BulkInsertAsync(notifications); } - + _logger.LogInformation( "Delivering notification in batch: {NotificationTopic} #{NotificationId} with meta {NotificationMeta}", notification.Topic, @@ -304,6 +304,6 @@ public class PushService } _logger.LogInformation( - $"Successfully pushed notification #{notification.Id} to device {subscription.DeviceId}"); + $"Successfully pushed notification #{notification.Id} to device {subscription.DeviceId} provider {subscription.Provider}"); } -} \ No newline at end of file +}