I have created a project in MVC5, I want to create an error log for same.
is there any way that we can get detailed information about the error.
as of now, i am catching exception like below.
catch (Exception Ex)
{
mailobj.SendMail(
this.ControllerContext.RouteData.Values["controller"].ToString(),
this.ControllerContext.RouteData.Values["action"].ToString(),
Convert.ToString(Ex.Message.Replace("<", "").Replace(">", "").ToString()),
Convert.ToString(Ex.HelpLink),
Convert.ToString(Ex.Source),
Convert.ToString(Ex.StackTrace),
Convert.ToString(Ex.TargetSite));
return Json("error in the system.!", JsonRequestBehavior.AllowGet);
}
hear send mail will send mail to admin about error.
but the problem is, I could not able to get complete details about the error for example, if you get error message like "Object reference not set to an instance of an object." I want to to what is the parameter value to get this data.
Is there any easy way that we can track the errors in the system.
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Vivek KumarPosted May 30, 2017, 4:35 PM
Thiruppathi RPosted May 30, 2017, 9:04 AM
Satheesh ElumalaiPosted May 30, 2017, 3:56 AM