Skip to content

Commit 7dd34e6

Browse files
authored
Merge pull request #94 from PandaTechAM/development
Logging message changed
2 parents 0863700 + c940fd6 commit 7dd34e6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/SharedKernel/Logging/Middleware/OutboundLoggingHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
139139
// Eliminates the BeginScope dictionary allocation and the LogInformation args-array allocation.
140140
[LoggerMessage(Level = LogLevel.Information,
141141
Message = "[HTTP OUT] {Method} {HostPath} -> {StatusCode} in {ElapsedMs}ms | " +
142-
"{Kind} q={Query} rqH={RequestHeaders} rqB={RequestBody} rsH={ResponseHeaders} rsB={ResponseBody}")]
142+
"{Kind} query={Query} requestHeader={RequestHeaders} requestBody={RequestBody} responseHeader={ResponseHeaders} responseBody={ResponseBody}")]
143143
private partial void LogHttpOut(string method,
144144
string hostPath,
145145
int statusCode,

src/SharedKernel/Logging/Middleware/RequestLoggingMiddleware.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public async Task InvokeAsync(HttpContext context)
2929
}
3030
finally
3131
{
32-
var elapsedMs = Stopwatch.GetElapsedTime(timestamp).TotalMilliseconds;
32+
var elapsedMs = Stopwatch.GetElapsedTime(timestamp)
33+
.TotalMilliseconds;
3334
var (resHeaders, resBody) = await CaptureResponseAsync(context, tee);
3435

3536
context.Response.Body = originalBody;
@@ -145,9 +146,8 @@ private static bool ShouldIgnorePath(PathString path) =>
145146
// Eliminates the BeginScope dictionary allocation and the LogInformation args-array allocation.
146147
[LoggerMessage(Level = LogLevel.Information,
147148
Message = "[HTTP IN] {Method} {Path} -> {StatusCode} in {ElapsedMs}ms | " +
148-
"{Kind} q={Query} rqH={RequestHeaders} rqB={RequestBody} rsH={ResponseHeaders} rsB={ResponseBody}")]
149-
private partial void LogHttpIn(
150-
string method,
149+
"{Kind} query={Query} requestHeader={RequestHeaders} requestBody={RequestBody} responseHeader={ResponseHeaders} responseBody={ResponseBody}")]
150+
private partial void LogHttpIn(string method,
151151
string? path,
152152
int statusCode,
153153
double elapsedMs,

src/SharedKernel/SharedKernel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageIcon>pandatech.png</PackageIcon>
2222
<PackageReadmeFile>README.md</PackageReadmeFile>
2323

24-
<Version>2.2.1</Version>
24+
<Version>2.2.2</Version>
2525
<PackageReleaseNotes>Request and Response logging modernized and has extreme perf boost for logging</PackageReleaseNotes>
2626

2727
<GenerateDocumentationFile>true</GenerateDocumentationFile>

0 commit comments

Comments
 (0)