Skip to content

Can the HostingRequestFinishedLog.ToString include the request url too? #10097

Closed
@kevinlo

Description

@kevinlo

HostingRequestFinishedLog.ToString currently just has the elapsedTime, but not the request URL.

"Request finished in {elapsedTime}ms {statusCode} {ContentType}",

It is easier to match with the Request starting if it can include the URL like this.

Request starting HTTP/1.1 GET http://myserver/myapi/myitem/123 [ 16984:92 ]
Request finished HTTP/1.1 GET http://myserver/myapi/myitem/123 in 501.525ms 200 application/json; charset=utf-8 [ 16984:98 ]

In my log files, sometimes it has a few Request finished around the same time and I cannot tell which one is which quickly without spending time to trace back the log.

This HostingRequestFinishedLog class is internal, I cannot find an easy way I can customize it to provide a custom ToString.

The HostingRequestStartingLog and HostingRequestFinishedLog are run in different thread, I cannot use the threadId to match the log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-hostingIncludes Hostingarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions