Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Logging exceptions is important for controlling your applications when they’re deployed. You can opt for your own way of storing this information, using a variation of the code shown in listing 15.1 and intercepting the Error event of HttpApplication, or by using one of the libraries available on the market. Both solutions have their own pros and cons: writing your own code is probably a win/win situation if you don’t want to include references to gigantic libraries in order to use only a small portion of their features; using third-part code lets you implement the task in less time.
No matter which method you choose, handling errors the right way is crucial from a security point of view: the less your attacker can see, the more secure your application is. In this section, you’ll learn how to protect your errors from others’ eyes, and, at the same time, log them for tracing purposes.