1

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.

DeveloperSD
  • 286
  • 2
  • 3
  • 19
  • What is "HTTP-Request/Response object"? You don't even have the actual class/property names? – Lex Li Apr 22 '19 at 13:23
  • class HttpContext (Microsoft.AspNetCore.Http) – DeveloperSD Apr 22 '19 at 14:02
  • You will have to split this to smaller questions, and then each can be answered separately. Some comes from HTTP header (cookie/user name), and some you cannot access at all (win32 status). – Lex Li Apr 22 '19 at 15:19
  • Could you please tell us that you does not find a proper property in httprequest/httpresponse object or parameter value is null? could you please provide some sample code which you tried? – Jalpa Panchal Apr 24 '19 at 09:21

0 Answers0