Enterprise Library 2.0 Tip (3): Record unhandled exceptions in ASP.net site

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.