Exemplo n.º 1
0
        public ILoggingEventContextBuilder IncludeBasicRequestInfo()
        {
            if (_request != null)
            {
                _props["Url"]       = _request.Url.OriginalString.CleanQueryString();
                _props["UserAgent"] = _request.UserAgent;
                _props.SafeSetProp("IPAddress", () => GetCallingIpAddress(_context));
                _props["RequestMethod"] = _request.HttpMethod;

                _props.SafeSetProp("RequestHeaders", () => _request.Headers.ToQuery());
                _props.SafeSetProp("Referrer", () => _request.ServerVariables["HTTP_REFERER"].CleanQueryString());
                _props.SafeSetProp("RawUrl", () => _request.RawUrl);
                _props.SafeSetProp("QueryString", () => _request.QueryString.ToString().CleanQueryString());
                _props.SafeSetProp("Server", () => _request.ServerVariables["LOCAL_ADDR"]);
            }
            return(this);
        }