Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log info with Elmah

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!

like image 414
zs2020 Avatar asked May 10 '13 18:05

zs2020


People also ask

What is ELMAH logging?

In this article ELMAH is a free, open source error logging library that includes features like error filtering and the ability to view the error log from a web page, as an RSS feed, or to download it as a comma-delimited file.

How do I check my ELMAH log?

Build the application, run it in the browser, and navigate to http://www.yoursite.com/elmah.axd. You are prompted to log in before you see the content. After a successful authentication, you see a web page to remotely view the entire log of recorded exceptions.

How do I log errors in VB net?

To log a handled exceptionCreate the method that will generate the exception information. Use a Try...Catch block to catch the exception. Put the code that could generate an exception in the Try block. Uncomment the Dim and MsgBox lines to cause a NullReferenceException exception.


1 Answers

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.

like image 108
Paige Cook Avatar answered Sep 19 '22 21:09

Paige Cook