diff --git a/src/Notifications/AzureQueueHostedService.cs b/src/Notifications/AzureQueueHostedService.cs index 9d1fcb1932..977d9a9d1d 100644 --- a/src/Notifications/AzureQueueHostedService.cs +++ b/src/Notifications/AzureQueueHostedService.cs @@ -65,7 +65,7 @@ public class AzureQueueHostedService : IHostedService, IDisposable try { await HubHelpers.SendNotificationToHubAsync( - message.DecodeMessageText(), _hubContext, _anonymousHubContext, cancellationToken); + message.DecodeMessageText(), _hubContext, _anonymousHubContext, _logger, cancellationToken); await _queueClient.DeleteMessageAsync(message.MessageId, message.PopReceipt); } catch (Exception e) diff --git a/src/Notifications/Controllers/SendController.cs b/src/Notifications/Controllers/SendController.cs index a5780517eb..7debd51df7 100644 --- a/src/Notifications/Controllers/SendController.cs +++ b/src/Notifications/Controllers/SendController.cs @@ -11,11 +11,13 @@ public class SendController : Controller { private readonly IHubContext _hubContext; private readonly IHubContext _anonymousHubContext; + private readonly ILogger _logger; - public SendController(IHubContext hubContext, IHubContext anonymousHubContext) + public SendController(IHubContext hubContext, IHubContext anonymousHubContext, ILogger logger) { _hubContext = hubContext; _anonymousHubContext = anonymousHubContext; + _logger = logger; } [HttpPost("~/send")] @@ -27,7 +29,7 @@ public class SendController : Controller var notificationJson = await reader.ReadToEndAsync(); if (!string.IsNullOrWhiteSpace(notificationJson)) { - await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext, _anonymousHubContext); + await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext, _anonymousHubContext, _logger); } } } diff --git a/src/Notifications/HubHelpers.cs b/src/Notifications/HubHelpers.cs index 8463e1f34a..53edb76389 100644 --- a/src/Notifications/HubHelpers.cs +++ b/src/Notifications/HubHelpers.cs @@ -14,10 +14,12 @@ public static class HubHelpers string notificationJson, IHubContext hubContext, IHubContext anonymousHubContext, + ILogger logger, CancellationToken cancellationToken = default(CancellationToken) ) { var notification = JsonSerializer.Deserialize>(notificationJson, _deserializerOptions); + logger.LogInformation("Sending notification: {NotificationType}", notification.Type); switch (notification.Type) { case PushType.SyncCipherUpdate: