Skip to content

Commit

Permalink
Merge pull request #181 from cnblogs/log-response-when-debugging
Browse files Browse the repository at this point in the history
feat: log response for debugging
  • Loading branch information
ikesnowy authored Nov 28, 2023
2 parents f0b9d69 + 543fc09 commit c378130
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MediatR;
using System.Text.Json;
using MediatR;

using Microsoft.Extensions.Logging;

Expand Down Expand Up @@ -31,7 +32,7 @@ public async Task<TResponse> Handle(
{
_logger.LogDebug("Handling {@Request}", request);
var result = await next();
_logger.LogDebug("Handled {@Request}", request);
_logger.LogDebug("Handled {@Request}, Response: {Response}", request, JsonSerializer.Serialize(result));
return result;
}
}
}

0 comments on commit c378130

Please sign in to comment.