From 543fc09e37c96f123fad875270eb0009728dd1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E6=98=9F=E7=B9=81?= Date: Tue, 28 Nov 2023 14:40:02 +0800 Subject: [PATCH] feat: log response for debugging --- .../LoggingBehavior.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/LoggingBehavior.cs b/src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/LoggingBehavior.cs index 1ff65d5..2cc23b7 100644 --- a/src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/LoggingBehavior.cs +++ b/src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/LoggingBehavior.cs @@ -1,4 +1,5 @@ -using MediatR; +using System.Text.Json; +using MediatR; using Microsoft.Extensions.Logging; @@ -31,7 +32,7 @@ public async Task 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; } -} \ No newline at end of file +}