TraceLoggingThreadActivity class (traceloggingactivity.h)

Provides support for logging ETW events during an activity. Events will be automatically tagged with or nested in this activity.

Inheritance

The TraceLoggingThreadActivity class implements _TlgActivityBase.

Methods

The TraceLoggingThreadActivity class has these methods.

 
TraceLoggingThreadActivity::Provider

TraceLoggingThreadActivity::Provider (traceloggingactivity.h) returns the handle to the TraceLogging provider associated with this activity.
TraceLoggingThreadActivity::TraceLoggingThreadActivity

Initializes a new instance of the TraceLoggingThreadActivity class. (overload 2/2)
TraceLoggingThreadActivity::TraceLoggingThreadActivity

Initializes a new instance of the TraceLoggingThreadActivity class. (overload 1/2)

Remarks

This class works by setting a per-thread variable. Only events occurring on the active thread will be automatically tagged.

In order to use TraceLogging activities, you need to define an instance of either TraceLoggingActivity or TraceLoggingThreadActivity. After you have created an instance of one of these classes, you manipulate activity logging using After you have created an instance of one of these classes, you manipulate activity logging using TraceLoggingFunction, TraceLoggingWriteStart, TraceLoggingWriteStop, and TraceLoggingWriteTagged. This class automatically creates a unique identifier when tracing is turned on and the activity is started.

Any active threads will be automatically nested in this instance when you start logging with a TraceLoggingThreadActivity object. In addition, all events will be automatically logged with this object's unique identifier.

Important

Only use this class when you can guarantee that all activities for this thread are fully nested. You must ensure that no child activity will outlast a parent activity, even in error cases or edge cases.

Note

In DEBUG builds, the class will raise an assertion during its Stop event, if it detects incorrect activity nesting, or if the Stop event occurs on a thread other than the thread used to start it.

This class is not available for store applications.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header traceloggingactivity.h

See also

TraceLoggingActivity Class