Enable exchange trace)

Source: Internet
Author: User
One interesting thing is that the exchange 2007 actually provides a set of diagnostics tracers interface for its internal agents. in Exchange 2003 age, it is hard to use them in our own application. but Exchange 2007 actually exposes them freely for the dev into Les. meanwhile, the tracers are very powerful and have the following advantages:

1. Easy to invoke and easy to use.
2. It is using ETL tracing. The performance impact is small than normal tracers like log files or event log or database.
3. We can use the tool "Mail Flow troubleshooter" in exchange management console to catch, view, search and export the trace (can be XML/CSV/html format ).

Is it cool?

Now let's talk How To this works:

In this example (C #), we will use the commontracer of the Exchange Server's internal diagnostic tracers.

// First of all, you need to add reference library by adding the following DLL file.
Exchange Server \ bin \ microsoft. Exchange. Diagnostics. dll

// Now you load the tracer functions.
// To Output Error Type trace
Extraceglobals. commontracer. traceerror ()

// To output debug type trace
Extraceglobals. commontracer. tracedebug (INT lid, long ID, String, Params)

// Others like
Extraceglobals. commontracer. tracewarning ()
Extraceglobals. commontracer. traceinformation ()
Extraceglobals. commontracer. tracefunction ()
Extraceglobals. commontracer. traceperformance ()
Extraceglobals. commontracer. PFD ()

// Sample code:
Extraceglobals. commontracer. tracedebug (this. gethashcode (), "My name is {0} {1}. I come from {2}", myfirstname, mysecondname, mycountry );

How to trace the agent
---------------------------------
The trace is using the Microsoft Exchange diagnostics tracer and provides very detail output for every step in the mail flow. we can enable, capture, view, search, and export the trace easily in Microsoft Exchange Management Console.

Note:
1. Trace cocould affect the server performance.

2. ETL trace file cocould be big on a busy server. Please make sure you have enough disk space.

To enable and catch trace:
1. open exchange management console, go to toolbox, open mailflow troubleshooter
2. Click "select a task" in the Left window, click "trace control" in the right window, and click OK.
3. Change the ETL filename and path, click "set manual trace tag"
4. Under "TRACE type", select one or several from PFD/fatal/error/warning/INFO/debug/function/performance.
5. Under "components to trace", select common.
6. Under "TRACE tag", fill the checkbox common. Leave the other checkboxes empty.
7. Click "Start tracing ".
8. After running a while or reproducing some issue, you can click "Stop tracing now" to stop trace.

To view trace:
In the left window, click "select a result file to view", select one report from the list, and then click "view result ".

To search words in the trace:
After opening one trace report, click "find" to find strings.

to export trace:
after opening one trace report, click Export report, you can then export the report into a file with HTML/XML/CSV format.

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.