public override void OnException(ExceptionContext context) { var errorLog = new CreateExceptionLogCommand { LogTime = DateTime.Now, HttpStatusCode = context.Exception.HResult, //RequestId = 10, ExceptionMessage = context.Exception.Message, ExceptionStackTrace = context.Exception.StackTrace }; _exceptionLogService.CreateExceptionRecord(errorLog); //need to execute the service somehow context.ExceptionHandled = true; }