@@ -32,10 +32,10 @@ private async Task LogRequest(HttpContext context)
3232 await using var requestStream = _recyclableMemoryStreamManager . GetStream ( ) ;
3333 await context . Request . Body . CopyToAsync ( requestStream ) ;
3434 _logger . LogInformation ( $ "Http Request Information:{ Environment . NewLine } " +
35- $ "Schema:{ context . Request . Scheme } " +
36- $ "Host: { context . Request . Host } " +
37- $ "Path: { context . Request . Path } " +
38- $ "QueryString: { context . Request . QueryString } " +
35+ $ "Schema:{ context . Request . Scheme } { Environment . NewLine } " +
36+ $ "Host: { context . Request . Host } { Environment . NewLine } " +
37+ $ "Path: { context . Request . Path } { Environment . NewLine } " +
38+ $ "QueryString: { context . Request . QueryString } { Environment . NewLine } " +
3939 $ "Request Body: { ReadStreamInChunks ( requestStream ) } ") ;
4040 context . Request . Body . Position = 0 ;
4141 }
@@ -72,10 +72,11 @@ private async Task LogResponse(HttpContext context)
7272 context . Response . Body . Seek ( 0 , SeekOrigin . Begin ) ;
7373
7474 _logger . LogInformation ( $ "Http Response Information:{ Environment . NewLine } " +
75- $ "Schema:{ context . Request . Scheme } " +
76- $ "Host: { context . Request . Host } " +
77- $ "Path: { context . Request . Path } " +
78- $ "QueryString: { context . Request . QueryString } " +
75+ $ "Schema:{ context . Request . Scheme } { Environment . NewLine } " +
76+ $ "Host: { context . Request . Host } { Environment . NewLine } " +
77+ $ "Path: { context . Request . Path } { Environment . NewLine } " +
78+ $ "QueryString: { context . Request . QueryString } { Environment . NewLine } " +
79+ $ "StatusCode: { context . Response ? . StatusCode } { Environment . NewLine } " +
7980 $ "Response Body: { text } ") ;
8081
8182 await responseBody . CopyToAsync ( originalBodyStream ) ;
0 commit comments