public override void SetProperties(ILoggerConfiguration config)
        {
            Message = Ex.GetFullMessage();
            base.SetProperties(config);

            if (MessageOnly)
            {
                return;
            }

            StackTrace = Ex.GetStackTrace();
            HighProperties.Add(StackTraceKey, StackTrace);
            MedProperties.Add(SourceKey, Ex.Source);
            LowProperties.Add(TitleKey, Title);
        }
Example #2
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);
            }
        }
Example #3
0
 public string GetLow(CaseInsensitiveBinaryList <string> hideKeys) => LowProperties.ToNameValueCollection().AsString(hideKeys);