I created webApi global exception handler, i have to log the request parameters/JSON in the prod environment to verify the request if any exception happened, Please let me know the way to log the request message with in the
ExceptionHandler.
WebApiConfig
public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Services.Replace(typeof (IExceptionHandler), new GlobalExceptionHandler()); } }
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)); } }