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
You should try Error Logging Modules And Handlers (ELMAH).
ELMAH is a free, opensource error logging library. It include features like:
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:
- ELMAH - Error Logging Modules and Handlers
- ELMAH Project Page (source code, samples, wiki)
- Plugging ELMAH Into a Web Application to Catch Unhandled Exceptions (video)
- Security Error Log Pages
- Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components
- Website Security Tutorials
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With