Retrieve IIS log parameter value from HTTP-Request

2020-03-30 05:48发布

问题:

I want to write custom log for my application similar to IIS log using .net core. For below fields I am not able to retrieve information from HTTP-Request/Response object.

Parameter :

. Service Name and Instance Number (s-sitename) . User Name (cs-username) . Cookie (cs - Cookie) . Protocol Substatus(sc substatus) . Win32 Status(sc-win32-status) . Bytes Sent (sc-bytes ) . Bytes Received (cs-bytes)

apart from above fields, I have able to extract other fields information. Example: [Server Name, Protocol Version etc]

Information regarding position of above fields inside [HTTP-Request/Response] object or .net core code to extract this information is required.