Yesterday I wrote about error handling, why it is important and how we can handle errors in IIS using ASP and a database. Joel has written a great article on more advanced error handling - a complete bug tracking system. Preferably, an error handling system and a bug tracking system should be integrated. Errors are bugs, but keep in mind that not all errors should be logged as bugs. In many cases this would results in a too large bug list, so a good way to keep the integration is to have the user report errors. Then the error is registered as a bug.
See Joel's article for more information: Joel on Software - Painless Bug Tracking