ExceptionHandler
public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Services.Replace(typeof (IExceptionHandler), new GlobalExceptionHandler()); } }
public class GlobalExceptionHandler : ExceptionHandler { public override void Handle(ExceptionHandlerContext context) { Logger.log("Exception : \t" + context.Exception.Message) Logger.log("Request JSON : \t" + Josn.Serializer(context.Request.Content)); } }
ExceptionHandlerContext
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)