i have a ASP.Net MVC project where i can integrate elmah but the problem is my project solution has many projects like asp.net mvc, BAL, DAL. if i integrate elmah in asp.net mvc project then i will not be able to log error by elmah from DAL or BAL. i want to log error from any project and for that i need to implement elmah in separate project.
i read two write up but still could not figure out the way to achieve my goal. those urls are
https://dzone.com/articles/writing-custom-error-loggers-for-elmah
https://www.codeproject.com/Articles/566705/Making-elmah-axd-a-log-viewer-for-multiple-applica
i am following first article link. they said we need to install elmah core library which i did and also i create a class file
ElmahLog : Elmah.ErrorLog extending Elmah.ErrorLog and override few elmah functions.
now do not understand what to write inside those function.
here is the code
so please tell me how to log error from the above function into sql server db. also tell me how to incorporate elmah.axd log viewer in asp.net mvc project to view all error which logged from my UI,DAL and BAL.
please tell me what config entries i need to add in mvc project and separate project where i add elmah core.
please guide me if anyone did it before.
i read two write up but still could not figure out the way to achieve my goal. those urls are
https://dzone.com/articles/writing-custom-error-loggers-for-elmah
https://www.codeproject.com/Articles/566705/Making-elmah-axd-a-log-viewer-for-multiple-applica
i am following first article link. they said we need to install elmah core library which i did and also i create a class file
ElmahLog : Elmah.ErrorLog extending Elmah.ErrorLog and override few elmah functions.
now do not understand what to write inside those function.
here is the code
publicclass ElmahLog : Elmah.ErrorLog
{
publicoverridestring Log(Error error)
{
thrownew System.NotImplementedException();
}
publicoverride ErrorLogEntry GetError(string id)
{
thrownew System.NotImplementedException();
}
publicoverrideint GetErrors(int pageIndex, int pageSize, IList errorEntryList)
{
thrownew System.NotImplementedException();
}
}
so please tell me how to log error from the above function into sql server db. also tell me how to incorporate elmah.axd log viewer in asp.net mvc project to view all error which logged from my UI,DAL and BAL.
please tell me what config entries i need to add in mvc project and separate project where i add elmah core.
please guide me if anyone did it before.