My client asked to handle all unhandled exception and log then in sql database. Beside that they want to log handled exception too. So after some googling i found an open source project for exception handling, ELMAH (Error Logging Modules and Handlers). I found it very easy to configure Elmah to the project, i forgot to say that the project is a Running project. There is no need to write and single code line, all about web.config configuration. I wrote some lines to log the handled exception and log them.
I do recommend you to try ELMAH.
Web.config encryption with external files by using aspnet_regiis made my go crazy; but i found a way to do that;
you may check here for more details and code snippet
http://weblogs.asp.net/muhanadyounis/pages/encrypt-web-config-including-extarnal-appsettings-and-connectionstrings-files.aspx
hope this helps