ELMAH is an awesome error logging framework for ASP.NET. It provides both an elegant way of capturing errors, and an elegant way of displaying them later. It's available as a NuGet package, and is both Web Forms and MVC friendly.
Generally, Elmah "just works" and you can walk away happy as a clam. But there's times where you want to do custom error logging. The general solution is to do something like this:
The up-side is you can log anything you want then gently recover. The down-side is you can't get the logged ErrorId. Granted, based on your Elmah filters, maybe...