Skip to content

Commit

Permalink
Update Error Logs to Properly Log Exception (#3603)
Browse files Browse the repository at this point in the history
  • Loading branch information
justindbaur authored Dec 28, 2023
1 parent be842c7 commit de30749
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Notifications/AzureQueueHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ await HubHelpers.SendNotificationToHubAsync(
}
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);
Expand All @@ -86,7 +86,7 @@ await HubHelpers.SendNotificationToHubAsync(
}
catch (Exception e)
{
_logger.LogError("Error processing messages.", e);
_logger.LogError(e, "Error processing messages.");
}
}

Expand Down

0 comments on commit de30749

Please sign in to comment.