views:

95

answers:

3

Hi folks,

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

+1  A: 

I'm sure your back office team could set up access directly to the logs, if you have a quick talk about how to do that securely.

Personally, I log tons of stuff out to log files because all sorts of information can be useful for a tricky situation. But I also log exceptions direct to the database and display them on a secure page so I can use that as a start point.

pdr
+4  A: 

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:

BrunoLM
this sounds promising...
SoftwareGeek
+2  A: 

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.

dcp
@dcp - i am using log4net but wasn't aware of SMTPAppender. i will give it a spin.
SoftwareGeek