Skip to content

Instantly share code, notes, and snippets.

@guntidheerajkumar
Created November 6, 2015 06:05
Show Gist options
  • Save guntidheerajkumar/da63cb7c824c1c924e22 to your computer and use it in GitHub Desktop.
Save guntidheerajkumar/da63cb7c824c1c924e22 to your computer and use it in GitHub Desktop.
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
// Retrieve the information what we need to log
string routeInfo = GetRouteData(filterContext.RouteData);
bool isActionSucceeded = filterContext.Exception == null;
string user = filterContext.HttpContext.User.Identity.Name;
Debug.WriteLine(String.Format("ActionExecuted - {0} ActionType: {1}; Executed successfully:{2}; User:{3}"
, routeInfo, ActionType, isActionSucceeded, user), "Audit Log");
base.OnActionExecuted(filterContext);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment