Пример #1
0
        /// <summary>
        /// Adds the current request info.
        /// </summary>
        /// <param name="context">The http context to gather information from.</param>
        /// <param name="config">The config.</param>
        public static RequestInfo GetRequestInfo(this HttpContextBase context, ExceptionlessConfiguration config)
        {
            if (context == null && HttpContext.Current != null)
            {
                context = HttpContext.Current.ToWrapped();
            }

            return(RequestInfoCollector.Collect(context, config));
        }
Пример #2
0
        /// <summary>
        /// Adds the current request info as extended data to the error.
        /// </summary>
        /// <param name="error">The error model.</param>
        /// <param name="context">The http action context to gather information from.</param>
        public static Error AddHttpRequestInfo(this Error error, HttpActionContext context)
        {
            if (context == null)
            {
                return(error);
            }

            // TODO: Create HttpActionContext version of request info.
            //context.Request.Headers.GetCookies();
            error.RequestInfo = RequestInfoCollector.Collect(context, ExceptionlessClient.Current);

            return(error);
        }
        /// <summary>
        /// Adds the current request info to the error.
        /// </summary>
        /// <param name="error">The error model.</param>
        /// <param name="client">The client.</param>
        /// <param name="context">The http context to gather information from.</param>
        public static Error AddRequestInfo(this Error error, ExceptionlessClient client, HttpContextBase context = null)
        {
            if (context == null && HttpContext.Current != null)
            {
                context = HttpContext.Current.ToWrapped();
            }

            if (context == null)
            {
                return(error);
            }

            error.RequestInfo = RequestInfoCollector.Collect(client, context);

            return(error);
        }
Пример #4
0
        /// <summary>
        /// Adds the current request info to the event.
        /// </summary>
        /// <param name="ev">The event model.</param>
        /// <param name="client">The client.</param>
        /// <param name="context">The http context to gather information from.</param>
        public static Event AddRequestInfo(this Event ev, ExceptionlessClient client, HttpContextBase context = null)
        {
            if (context == null && HttpContext.Current != null)
            {
                context = HttpContext.Current.ToWrapped();
            }

            if (context == null)
            {
                return(ev);
            }

            ev.AddRequestInfo(RequestInfoCollector.Collect(context, client.Configuration));

            return(ev);
        }
Пример #5
0
 /// <summary>
 /// Adds the current request info.
 /// </summary>
 /// <param name="context">The http context to gather information from.</param>
 /// <param name="config">The config.</param>
 public static RequestInfo GetRequestInfo(this HttpContext context, ExceptionlessConfiguration config)
 {
     return(RequestInfoCollector.Collect(context, config.DataExclusions));
 }
 /// <summary>
 /// Adds the current request info.
 /// </summary>
 /// <param name="context">The nancy context to gather information from.</param>
 /// <param name="config">The config.</param>
 public static RequestInfo GetRequestInfo(this NancyContext context, ExceptionlessConfiguration config)
 {
     return(RequestInfoCollector.Collect(context, config));
 }