I'm trying to output to Trace.axd from an ASP.NET MVC app. I have traces in OnActionExecuting(), OnActionExecuted(), OnResultExecuting() and OnResultExecuted() and all of them output to Trace.axd except for OnResultExecuted().
For completeness' sake here's my code (exactly the same for OnActionX() ):
protected override void OnResultExecuting(ResultExecutingContext filterContext)
{
resultStartTime = DateTime.Now;
filterContext.HttpContext.Trace.Warn("OnResultExecuting: " + actionStartTime);
base.OnResultExecuting(filterContext);
}
protected override void OnResultExecuted(ResultExecutedContext filterContext)
{
DateTime resultEndTime = DateTime.Now;
filterContext.HttpContext.Trace.Warn("OnResultExecuted: " + resultEndTime);
filterContext.HttpContext.Trace.Warn("OnResultExecuted - OnResultExecuting: " + (resultEndTime - resultStartTime).TotalSeconds);
base.OnResultExecuted(filterContext);
}
I am using ELMAH but I have disabled it and I still get the problem.