Skip to content

Commit b7e2156

Browse files
committed
Update log message
1 parent 0bb56a7 commit b7e2156

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Http/Http/src/Builder/ApplicationBuilder.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public RequestDelegate Build()
148148
if (logger != null && logger.IsEnabled(LogLevel.Information))
149149
{
150150
Log.RequestPipelineEnd(logger,
151-
context.Request.Protocol,
152151
context.Request.Method,
153152
context.Request.Scheme,
154153
context.Request.Host.Value,
@@ -171,8 +170,8 @@ public RequestDelegate Build()
171170
private static partial class Log
172171
{
173172
[LoggerMessage(1, LogLevel.Information,
174-
"Request reached the end of the middleware pipeline without being handled by application code {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path} - {StatusCode}",
173+
"Request reached the end of the middleware pipeline without being handled by application code. Request path: {Method} {Scheme}://{Host}{PathBase}{Path}, Response status code: {StatusCode}",
175174
SkipEnabledCheck = true)]
176-
public static partial void RequestPipelineEnd(ILogger logger, string protocol, string method, string scheme, string host, string? pathBase, string? path, int statusCode);
175+
public static partial void RequestPipelineEnd(ILogger logger, string method, string scheme, string host, string? pathBase, string? path, int statusCode);
177176
}
178177
}

src/Http/Http/test/ApplicationBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public async Task BuildLogAtRequestPipelineEnd()
100100
Assert.Equal(404, httpContext.Response.StatusCode);
101101

102102
var log = TestSink.Writes.Single(w => w.EventId.Name == "RequestPipelineEnd");
103-
Assert.Equal("Request reached the end of the middleware pipeline without being handled by application code HTTP/2 GET https://localhost:5000/pathbase/path - 404", log.Message);
103+
Assert.Equal("Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:5000/pathbase/path, Response status code: 404", log.Message);
104104
}
105105

106106
[Fact]

0 commit comments

Comments
 (0)