Introduction to. Net Tracing

Source: Internet
Author: User

Why use. Net tracing?

====================

Sometimes, various tools are insufficient for you to learn more about the problem. for example, when different components on an independent server communicate, information exchange is not transmitted over the network and network packets cannot be captured. or when multiple servers communicate with each other using HTTPS (SSL), the specific content of the communication is encrypted and cannot be seen even when packets are captured. this is required. net tracing.

 

Principles of. Net Tracing

====================

. NET Framework itself provides support for such log output.

. Net ApplicationsProgramCheck whether a configuration file exists at startup. this configuration file must have the same name as the executable file of the application, except for the config suffix. in addition, the configuration file must be in the same folder as the executable file. assume that our executable file is called myapplication.exe, so the name of the configuration file should be myapplication.exe. config. you can write the specific tracing configuration in this file.

 

Example

====================

 <  Configuration  > <  System. Diagnostics > <  Trace  Autoflush  = " False " Indentsize  = " 4 " > <  Listeners  > <  Add  Name  = " Mylistener " Type = " System. diagnostics.Textwritertracelistener, System " Initializedata  = " C: \ mylistener. Log " /> <  Remove  Type  = " System. Diagnostics. defaulttracelistener, System " /> </  Listeners  > </  Trace > </  System. Diagnostics  > </  Configuration  > 

 

Microsoft provides three trace listener types:

    • Defaulttracelistener: Has the default behavior. That is, if the application is in the command line format, the information is output to the console. If the application is not in the command line format, the information is output to the output window of.
    • Eventlogtracelistener: Write trace information to the specified event log.
    • Textwritertracelistener: write information to a text file.

The preceding configuration needs to beCodeThe statement in is used together as follows:

// Tracing listeners demo // purpose: to demonstrate how // to use listenersUsingSystem;UsingSystem. diagnostics;NamespaceAssertion {ClassApplication{[Stathread]Static voidMain (String[] ARGs ){Trace. Writeline ("Calling writeline method","Tracing listeners Demo");Trace. Flush ();}}}

 

Practical Application

======================

Kb947285 describes how to use. Net trace to troubleshoot content deployment and search crawling problems.

TheArticleVery valuable.

 

References:

How to Use System. Net tracing to troubleshoot content deployment issues and search issues in Windows SharePoint Services 3.0 and in Sharepoint Server 2007

Http://support.microsoft.com/kb/947285

Debugging in. net

Http://www.automatedqa.com/techpapers/net-debugging/

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.