Question

is there any message type I can specify in the Elmah settings? It seems it can only log errors but not normal messages.

Or is there any plug in for Elmah to handle that?

Thanks in advance!

Was it helpful?

Solution

According to the post - ELMAH for simple logging from the Elmah Google Groups:

ELMAH is not a general purpose logging facility so I would discourage using it such. It is designed and therefore best suited for logging unhandled exceptions. You can however use ELMAH together with a general purpose logger

There are many general purpose logger available, like NLog, log4net, Enterprise Library, Common Logging, etc. I would suggest you look into some of these as solutions for general purpose logging. Some of these provide bridges for Elmah that you may be able to leverage.

OTHER TIPS

You can manually call ELMAH to log an Exception. You should confirm however that this is the best solution to your issue.

HttpException foo = new HttpException(this.Response.StatusCode, this.Response.StatusDescription);
Elmah.ErrorSignal.FromCurrentContext().Raise(foo);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top