Skip to content

Improve the log LogRequestHandlerCompleted to include the request duration #1022

@Meir017

Description

@Meir017

Is your feature request related to a problem? Please describe.
The log

private partial void LogRequestHandlerCompleted(string endpointName, string method);
just mentions the request completed.

I think we should improve it to be more like the aspnetcore request completed log that includes the duration, maybe also content length.

called from here

LogRequestHandlerCalled(EndpointName, request.Method);
JsonNode? result = await handler(request, cancellationToken).ConfigureAwait(false);
LogRequestHandlerCompleted(EndpointName, request.Method);

maybe we could measure the duration here?

sample logs as seen in vscode

Image

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions