How to get site name value in HttpContext in c#? RRS feed

  • Question

  • User-2049192058 posted

    I am going to write custom module for Advanced logging . in i need to process the HttpContext to get required data .IIS XMl config for my site . 

    <site name="Testing" id="8" serverAutoStart="true">
                    <application path="/">
                        <virtualDirectory path="/" physicalPath="D:\Test\Test" />
                        <binding protocol="http" bindingInformation="*:88:" />
                    <logFile logExtFileFlags="Date, Time, ClientIP, UserName, SiteName, ComputerName, ServerIP, Method, UriStem, UriQuery, HttpStatus, Win32Status, BytesSent, BytesRecv, TimeTaken, ServerPort, UserAgent, Cookie, Referer, ProtocolVersion, Host, HttpSubStatus" logFormat="W3C" logTargetW3C="File, ETW" period="Daily" enabled="true" />
                    <traceFailedRequestsLogging enabled="true" directory="C:\inetpub\logs\FailedReqLogFiles" />

    I can able to get id value (i.e 8) in HttpContext ,but i can't able to get the site name  value (i.e Testing) in my current HttpContext. How can i get that?


    Monday, December 1, 2014 4:28 AM

All replies