I am trying to use ELMAH for error logging in my ASP.NET MVC application. I installed the ELMAH.MVC package from NuGet Packaage Manager. I think I understand the basics of ELMAH, after having gone through a lot of online resources.
I am trying to implement a custom logger that will log specific details about the error into specific columns of a table in my database. I can't use the inbuilt SqlErrorLog
because it has some constraints which I cannot accommodate, like having tables and stored procedures with specific names. Hence, I wrote my own custom logger, deriving from SqlErrorLog
.
The problem is, I don't know what to do inside the three methods that I need to override - GetError
, GetErrors
and Log
. Sure, the name gives some idea, but I need more specifics. For example, why is the return value of Log
string
? What do I need to return?
Surprisingly, the assembly is devoid of any documentation, and I have had no luck whilst attempting to look for detailed documentation on the internet.
Can someone point me to a resource such as the detailed documentation of all the classes/methods in ELMAH, or maybe a sample custom logger implementation with comments?