예제 #1
0
        public override Task OnExceptionAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
        {
            if (HttpContext.Current != null && actionExecutedContext.Exception != null)
            {
                HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
                InternalExceptionLogger.LogException(actionExecutedContext.Exception, httpContext);
            }

            return(base.OnExceptionAsync(actionExecutedContext, cancellationToken));
        }
        public override Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
        {
            if (HttpContext.Current != null && context.Exception != null)
            {
                HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
                InternalExceptionLogger.LogException(context.Exception, httpContext);
            }

            return(base.LogAsync(context, cancellationToken));
        }
예제 #3
0
        public override void OnException(HttpActionExecutedContext actionExecutedContext)
        {
            if (HttpContext.Current != null && actionExecutedContext.Exception != null)
            {
                HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
                InternalExceptionLogger.LogException(actionExecutedContext.Exception, httpContext);
            }

            base.OnException(actionExecutedContext);
        }
        public override void Log(ExceptionLoggerContext context)
        {
            if (HttpContext.Current != null && context.Exception != null)
            {
                HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
                InternalExceptionLogger.LogException(context.Exception, httpContext);
            }

            base.Log(context);
        }