aspnetrequest server variables' values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

aspnetrequest server variables' values

Shivinder Singh
How/where can I get the values of server variables logged by the aspnet-request conversion pattern?

This is what I'm getting currently for my ASP.NET MVC application.

{ASP.NET_SessionId, ALL_HTTP, ALL_RAW, APPL_MD_PATH, APPL_PHYSICAL_PATH, AUTH_TYPE, AUTH_USER, AUTH_PASSWORD, LOGON_USER, REMOTE_USER, CERT_COOKIE, CERT_FLAGS, CERT_ISSUER, CERT_KEYSIZE, CERT_SECRETKEYSIZE, CERT_SERIALNUMBER, CERT_SERVER_ISSUER, CERT_SERVER_SUBJECT, CERT_SUBJECT, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, HTTPS, HTTPS_KEYSIZE, HTTPS_SECRETKEYSIZE, HTTPS_SERVER_ISSUER, HTTPS_SERVER_SUBJECT, INSTANCE_ID, INSTANCE_META_PATH, LOCAL_ADDR, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_PORT, REQUEST_METHOD, SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PORT_SECURE, SERVER_PROTOCOL, SERVER_SOFTWARE, URL, HTTP_CONNECTION, HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HTTP_COOKIE, HTTP_HOST, HTTP_USER_AGENT}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: aspnetrequest server variables' values

Ron Grabowski
It's not possible using any of the built-in patterns although it should be simple enough to write your own:

// untested
public class AspNetRequestServerPatternConverter : PatternLayoutConverter
{
    protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
    {
        if (HttpContext.Current != null &&
            HttpContext.Current.Request != null)
        {
            writer.Write(HttpContext.Current.Request.ServerVariables[Option]);
        }
        else
        {
            writer.Write(SystemInfo.NotAvailableText);
        }
    }
}

I'll look into adding something similar to /trunk


From: Shivinder Singh <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Monday, March 7, 2016 10:30 AM
Subject: aspnetrequest server variables' values

How/where can I get the values of server variables logged by the aspnet-request conversion pattern?

This is what I'm getting currently for my ASP.NET MVC application.

{ASP.NET_SessionId, ALL_HTTP, ALL_RAW, APPL_MD_PATH, APPL_PHYSICAL_PATH, AUTH_TYPE, AUTH_USER, AUTH_PASSWORD, LOGON_USER, REMOTE_USER, CERT_COOKIE, CERT_FLAGS, CERT_ISSUER, CERT_KEYSIZE, CERT_SECRETKEYSIZE, CERT_SERIALNUMBER, CERT_SERVER_ISSUER, CERT_SERVER_SUBJECT, CERT_SUBJECT, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, HTTPS, HTTPS_KEYSIZE, HTTPS_SECRETKEYSIZE, HTTPS_SERVER_ISSUER, HTTPS_SERVER_SUBJECT, INSTANCE_ID, INSTANCE_META_PATH, LOCAL_ADDR, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_PORT, REQUEST_METHOD, SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PORT_SECURE, SERVER_PROTOCOL, SERVER_SOFTWARE, URL, HTTP_CONNECTION, HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HTTP_COOKIE, HTTP_HOST, HTTP_USER_AGENT}


Loading...