Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET - Exception Logging & Monitoring

What's the best way to monitor exception logging in production environment? I have an application where in exceptions are logged to a text file. Everytime, i need access to these log files, i got to request backoffice team to send me a copy.

To improvise this process, i have thought of few options:

1) Email the error logs on a regular basis

2) Store the log file in database

3) Create some sort of listener objects to monitor logs (is this even possible?)

Is there a better option & how to implement one?

TIA

like image 367
SoftwareGeek Avatar asked Jul 22 '10 01:07

SoftwareGeek


2 Answers

You should try Error Logging Modules And Handlers (ELMAH).

ELMAH is a free, opensource error logging library. It include features like:

  • Error filtering
  • View errors on a webpage (configurable user roles)
  • RSS feed
  • Download as CSV file
  • Programmatically raise exception directly to it
  • Notifications through email

For information on how to install and use check its page.

Further Reading

For more information on the topics discussed in this tutorial, refer to the following resources:

like image 145
BrunoLM Avatar answered Sep 20 '22 14:09

BrunoLM


I highly recommend log4net. You can do just about any type of logging with it, and plus, there's even an SMPTAppender example on the documentation page, found here. So you could actually mail the exceptions directly to whomever you'd like, you could store them in the DB, the possibilities are really endless.

like image 28
dcp Avatar answered Sep 21 '22 14:09

dcp