Created
May 7, 2015 19:29
-
-
Save coreypnorris/db1df6213120cfa0fae7 to your computer and use it in GitHub Desktop.
Foundation for a logging file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in App_Start/FilterConfig.cs | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using OdeToFood.Filters; | |
| namespace OdeToFood | |
| { | |
| public class FilterConfig | |
| { | |
| public static void RegisterGlobalFilters(GlobalFilterCollection filters) | |
| { | |
| filters.Add(new LogAttribute()); | |
| filters.Add(new HandleErrorAttribute()); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in Filters/LogAttribute.cs | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Http.Controllers; | |
| using System.Web.Http.Filters; | |
| using System.Web.Mvc; | |
| namespace OdeToFood.Filters | |
| { | |
| public class LogAttribute : System.Web.Mvc.ActionFilterAttribute | |
| { | |
| public override void OnActionExecuting(ActionExecutingContext filterContext) | |
| { | |
| base.OnActionExecuting(filterContext); | |
| } | |
| public override void OnActionExecuted(ActionExecutedContext filterContext) | |
| { | |
| base.OnActionExecuted(filterContext); | |
| } | |
| public override void OnResultExecuted(ResultExecutedContext filterContext) | |
| { | |
| base.OnResultExecuted(filterContext); | |
| } | |
| public override void OnResultExecuting(ResultExecutingContext filterContext) | |
| { | |
| base.OnResultExecuting(filterContext); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment