コード例 #1
0
        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            MonitorLog monLog = filterContext.Controller.ViewData[this.key] as MonitorLog;

            monLog.ExecuteEndTime = DateTime.Now;
            LoggerHelper.Monitor(monLog.GetLogInfo(MonitorLog.MonitorType.View));
            filterContext.Controller.ViewData.Remove(this.key);
        }
コード例 #2
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            MonitorLog monLog = new MonitorLog();

            monLog.ExecuteStartTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.ffff", DateTimeFormatInfo.InvariantInfo));
            monLog.ControllerName   = filterContext.RouteData.Values["controller"] as string;
            monLog.ActionName       = filterContext.RouteData.Values["action"] as string;
            filterContext.Controller.ViewData[this.key] = monLog;
        }
コード例 #3
0
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            MonitorLog monLog = filterContext.Controller.ViewData[this.key] as MonitorLog;

            monLog.ExecuteEndTime   = DateTime.Now;
            monLog.FormCollections  = filterContext.HttpContext.Request.Form;        //form表单提交的数据
            monLog.QueryCollections = filterContext.HttpContext.Request.QueryString; //Url 参数
            LoggerHelper.Monitor(monLog.GetLogInfo());
        }
コード例 #4
0
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            var monLog = new MonitorLog();

            monLog.ExecuteStartTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.ffff", DateTimeFormatInfo.InvariantInfo));

            monLog.ControllerName = actionContext.ActionDescriptor.ControllerDescriptor.ControllerName;
            monLog.ActionName     = actionContext.ActionDescriptor.ActionName;
            actionContext.Request.Properties[this.key] = monLog;
        }
コード例 #5
0
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            MonitorLog monLog = filterContext.Controller.ViewData[this.key] as MonitorLog;

            monLog.ExecuteStartTime = DateTime.Now;
        }