From de30749628c0b8700a539a1cf06f3256690dcf72 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Thu, 28 Dec 2023 13:50:33 -0500 Subject: [PATCH] Update Error Logs to Properly Log Exception (#3603) --- src/Notifications/AzureQueueHostedService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Notifications/AzureQueueHostedService.cs b/src/Notifications/AzureQueueHostedService.cs index f0cc28ac8..9d1fcb193 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."); } }