I have a custom ActionFilterAttributes in my solution, and using OnActionExecuting to do some logs. However, the problem occurs because I want to trace the entire path taken during an action, and if by chance an action makes a call to another for some reason OnActionExecuting only triggers on the first call.
This is my ActionFilterAttribute
public class LogFilterAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
Log(filterContext.ActionDescriptor.ActionName)
}
}
This is an example of a action that calls another.
[LogFilterAttribute]
public class CarouselController
{
public ActionResult GetCarousel()
{
return ShowDialog()
}
public ActionResult ShowDialog()
{
//some code
}
}
In my understanding, after the GetCarousel action is called, the OnActionExecuting should be triggered twice, once with the value of GetCarousel and another with the value of showDialog. However this is not the resulting behavior because it is only triggered for the first action.
What will be the problem? how can i get the expected result? Thanks in advance