diff --git a/src/Notifications/AzureQueueHostedService.cs b/src/Notifications/AzureQueueHostedService.cs index f0cc28ac8e..9d1fcb1932 100644 --- a/src/Notifications/AzureQueueHostedService.cs +++ b/src/Notifications/AzureQueueHostedService.cs @@ -70,8 +70,8 @@ public class AzureQueueHostedService : IHostedService, IDisposable } catch (Exception e) { - _logger.LogError("Error processing dequeued message: " + - $"{message.MessageId} x{message.DequeueCount}. {e.Message}", e); + _logger.LogError(e, "Error processing dequeued message: {MessageId} x{DequeueCount}.", + message.MessageId, message.DequeueCount); if (message.DequeueCount > 2) { await _queueClient.DeleteMessageAsync(message.MessageId, message.PopReceipt); @@ -86,7 +86,7 @@ public class AzureQueueHostedService : IHostedService, IDisposable } catch (Exception e) { - _logger.LogError("Error processing messages.", e); + _logger.LogError(e, "Error processing messages."); } }