Пример #1
0
        public override void SetProperties(ILoggerConfiguration config)
        {
            base.SetProperties(config);
            var hideKeys = config.HideKeys();

            // Most are set in Initialize
            if (!string.IsNullOrWhiteSpace(Route))
            {
                HighProperties.Add(RouteKey, Route);
            }
            if (!string.IsNullOrWhiteSpace(HttpMethod))
            {
                HighProperties.Add(MethodKey, HttpMethod);
            }
            if (config.Include(HeadersKey))
            {
                MedProperties.Add(HeadersKey, GetHeaders());
            }
            if (config.Include(QueryStringKey))
            {
                MedProperties.Add(QueryStringKey, QueryString.AsString(hideKeys));
            }
            if (config.Include(FormKey))
            {
                MedProperties.Add(FormKey, FormData.AsString(hideKeys));
            }
            if (config.Include(RequestDataKey))
            {
                SetRequestData(); // Raw info was saved in Initialize
                MedProperties.Add(RequestDataKey, RequestUserData.AsString(hideKeys));
            }
            if (!string.IsNullOrWhiteSpace(Browser) && config.Include(BrowserKey))
            {
                LowProperties.Add(BrowserKey, Browser);
            }
        }
Пример #2
0
 public virtual async Task Initialize(ILoggerConfiguration config)
 {
     InitializeResult(TraceEventType.Information, RequestData.DisplayUrl);
     // Need to save off anything from the request/context objects here in the main thread
     SetRoute();
     SetMethod();
     SetHeaders();
     SetQueryString();
     SetFormData();
     if (config.Include(RequestDataKey))
     {
         ContentData = await RequestData.ContentData();
     }
     SetBrowser();
 }
Пример #3
0
        public override void SetProperties(ILoggerConfiguration config)
        {
            base.SetProperties(config);

            HighProperties.Add(ConnectionKey, CnnName);

            if (!config.Include(ParametersKey))
            {
                return;
            }

            SetSqlParams();
            var hideKeys = config.HideKeys();

            MedProperties.Add(ParametersKey, SqlParams.AsString(hideKeys));
        }
Пример #4
0
        public override void UpdateProperties(ILoggerConfiguration config)
        {
            base.UpdateProperties(config);

            if (StatusCode == 0)
            {
                return;
            }

            HighProperties.Add(StatusCodeKey, StatusCode.ToString());

            if (!config.Include(ResultKey))
            {
                return;
            }

            SetResponse();
            var hideKeys = config.HideKeys();

            MedProperties.Add(ResultKey, Response.AsString(hideKeys));
        }
Пример #5
0
        public override void SetProperties(ILoggerConfiguration config)
        {
            base.SetProperties(config);

            if (!string.IsNullOrWhiteSpace(Route))
            {
                HighProperties.Add(RouteKey, Route);
            }

            if (!string.IsNullOrWhiteSpace(HttpMethod))
            {
                HighProperties.Add(MethodKey, HttpMethod);
            }

            if (!config.Include(RequestDataKey))
            {
                return;
            }

            SetData();
            var hideKeys = config.HideKeys();

            MedProperties.Add(RequestDataKey, DataNvc.AsString(hideKeys));
        }