This article is not a trick of Enterprise Library 2.0, just a simple application of logging Application block, where we use logging application Block to record a asp.net 2.0 site unhandled exception to the database, of course, you can also record in the text file, or sent to the designated email, below to see the specific implementation steps.
1. Creating database tables and stored procedures
In the Src\logging\tracelisteners\database\scripts folder of the installation directory, Perform createloggingdb.cmd, and note that the loggingdatabase.sql should be saved in Unicode format before this (see Tip 2). When the installation is complete, a logging database will be created with three data tables and four related stored procedures.
2. Create a new Web site and configure it
After you create a new Web site, add the Web.config file, open it with EntLibConfig.exe, create a new logging Application block, and then create a new database Trace Listener:
Sets the parameters of the database Trace listener, including stored procedure names, and also relies on Daab: