RFID conference sign-in system summary (4)-Exception Handling and logging

Source: Internet
Author: User

 

This article is not yet ready to enter a substantive stage. First, inserting segments is related to the exception handling part of the entire system.

The most basic principle is, of course, all exceptions that may affect the normal operation of the system.CatchAnd keep a record. The most basic principle can only be grasped at the specific implementation stage. However, when there are always hundreds of thousands of leaksApplication. threadexceptionAndAppdomain. currentdomain. unhandledexceptionThe event is handled as needed.

For exceptions that have already occurred in the above two events, not only must they be recorded, but also Error In the form of dialog box reminder, otherwise the status is unknown. Whether to disable the entire applicationProgramIn principle, the system ignores this vulnerability. There is only one situation: Unhandledexception Event parameters in Isterminating Is True You must close the application. Applicationexit Timely clear some resources in the event.

Of course, exception handling is a big topic. In some cases, an exception should be thrown specially. These things need to be analyzed in detail. Here we will only mention some general practices in the system.

 

Logging is also an important part. The items to be recorded include some program exceptions, network exceptions, system startup and exit, and some important operations. There is also a large number of received communication commands, a large numberRFIDThe information read by the hardware device. The system has been running steadily and steadily. These items are not useful, but once the system is in good condition, these records will be the basis for solving the problem and troubleshooting.

Log records are determined from various aspects Log4net Now you have to think about how to configure it. Finally, the system uses two Appender , Eventlogappender Used to record exception information, including program and network exceptions. This information is generally not much, and is recorded in EventLog In my opinion, program exceptions are generally defined as" Error "Level, only in Threadexception And Unhandledexception The event is defined as" Fatal ", While the network exception uses" Warn ". Another Appender Yes Rollinglogfileappender Used to record operation information, communication information, and hardware information. This record volume is large and it is necessary to generate a log file in an hour. Info " level.

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.