public override void OnActionExecuting(ActionExecutingContext filterContext) { //create our request tracking object var tracker = new MvcRequestMetric(filterContext); // Store this on the request HttpContext.Current.Store(tracker); //And log the request if (_configuration.LogRequests) { var caption = string.Format("Web Site {0} {1} Requested", tracker.ControllerName, tracker.ActionName); var requestLogging = new MonitorRequestLogging(filterContext, _configuration); requestLogging.Log(Category,caption,tracker.UserName, tracker); } base.OnActionExecuting(filterContext); }
public override void OnActionExecuting(HttpActionContext actionContext) { //create our request tracking object var tracker = new WebApiRequestMetric(actionContext); // Store this on the request actionContext.Request.Store(tracker); //And log the request if (_configuration.LogRequests == false) return; var caption = string.Format("Api {0} {1} Requested", tracker.ControllerName, tracker.ActionName); var requestLogging = new MonitorRequestLogging(actionContext,_configuration); requestLogging.Log(Category,caption,tracker.UserName,tracker); base.OnActionExecuting(actionContext); }