public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (SkipLogging(filterContext))//是否该类标记为NoLog
            {
                return;
            }
            filterContext.HttpContext.Items[StopwatchKey] = Stopwatch.StartNew();

            var    actionArguments = filterContext.ActionParameters;
            string arguments       = JsonUtil.ConvertArgumentsToJson(actionArguments);//参数

            filterContext.HttpContext.Items[ArgumentsKey] = arguments;
        }
        /// <summary>
        /// 在请求执行完后 记录请求的数据以及返回数据
        /// </summary>
        /// <param name="actionExecutedContext"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            try
            {
                object watch = null;
                if (actionExecutedContext.Request.Properties.TryGetValue(StopwatchKey, out watch))
                {
                    string errorString = "";
                    //记录异常日志
                    if (actionExecutedContext.Exception != null)
                    {
                        errorString = JsonConvert.SerializeObject(actionExecutedContext.Exception);
                        logger.Error(actionExecutedContext.Exception);
                    }

                    var stopwatch = (Stopwatch)actionExecutedContext.Request.Properties[StopwatchKey];
                    stopwatch.Stop();

                    var arguments   = JsonUtil.ConvertArgumentsToJson(actionExecutedContext.ActionContext.ActionArguments);
                    var s           = actionExecutedContext.Request.Content.ReadAsStringAsync().Result;
                    var httpContext = HttpContext.Current;
                    var auditInfo   = new AuditInfo()
                    {
                        Exception         = errorString,
                        MethodName        = actionExecutedContext.ActionContext.ActionDescriptor.ActionName,
                        ExecutionTime     = DateTime.Now,
                        ExecutionDuration = stopwatch.ElapsedMilliseconds,
                        Parameters        = arguments,
                        ServiceName       =
                            actionExecutedContext.ActionContext.ControllerContext.ControllerDescriptor.ControllerType
                            .FullName,
                        BrowserInfo     = HttpContextExtension.GetBrowserInfo(httpContext),
                        ClientIpAddress = HttpContextExtension.GetClientIpAddress(httpContext),
                        ClientName      = HttpContextExtension.GetComputerName(httpContext),
                        Result          =
                            actionExecutedContext.Response != null
                                ? actionExecutedContext.Response.Content.ReadAsStringAsync().Result
                                : null
                    };
                    SaveAuditInfo(auditInfo);
                }
            }
            catch
            {
            }
            base.OnActionExecuted(actionExecutedContext);
        }