Simone Busoli, published a nice article on DotNetSlackers showing a detailed overview of the ELMAH open source project. ELMAH is a module that you can plugin into your existing ASP.NET application to log errors either in SQL, Memory, SQLLite (also written by Simone) etc.. ELMAH has been around for a while and I use it almost on all of my projects. If you are not familar with it, I strongly suggest you try it out. Here is a snipp from the homepage of ELMAH:
ELMAH (Error Logging Modules and Handlers) is an application-wide error
logging facility that is completely pluggable. It can be dynamically
added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.