EventSource Class
Provides the ability to create events for event tracing for Windows (ETW).
Namespace: System.Diagnostics.Tracing
Assembly: mscorlib (in mscorlib.dll)
The EventSource type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | EventSource() | Creates a new instance of the EventSource class. |
![]() ![]() | EventSource(Boolean) | Creates a new instance of the EventSource class and specifies whether to throw an exception when an error occurs in the underlying Windows code. |
| Name | Description | |
|---|---|---|
![]() | ConstructionException | [This topic is preliminary and is subject to change.] Gets any exception that was thrown during the construction of the event source. |
![]() ![]() | CurrentThreadActivityId | [This topic is preliminary and is subject to change.] Gets the activity ID of the current thread. |
![]() ![]() | Guid | The unique identifier for the event source. |
![]() ![]() | Name | The friendly name of the class that is derived from the event source. |
| Name | Description | |
|---|---|---|
![]() ![]() | Dispose() | Releases all resources used by the current instance of the EventSource class. |
![]() ![]() | Dispose(Boolean) | Releases the unmanaged resources used by the EventSource class and optionally releases the managed resources. |
![]() ![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() | Finalize | Allows the EventSource object to attempt to free resources and perform other cleanup operations before the object is reclaimed by garbage collection. (Overrides Object::Finalize().) |
![]() ![]() ![]() | GenerateManifest | Returns a string of the XML manifest that is associated with the current event source. |
![]() ![]() ![]() | GetGuid | Gets the unique identifier for this implementation of the event source. |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() ![]() | GetName | Gets the friendly name of the event source. |
![]() ![]() ![]() | GetSources | Gets a snapshot of all the event sources for the application domain. |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | IsEnabled() | Determines whether the current event source is enabled. |
![]() ![]() | IsEnabled(EventLevel, EventKeywords) | Determines whether the current event source that has the specified level and keyword is enabled. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | OnEventCommand | Called when the current event source is updated by the controller. |
![]() ![]() ![]() | SendCommand | Sends a command to a specified event source. |
![]() ![]() | SetCurrentThreadActivityId(Guid) | [This topic is preliminary and is subject to change.] Sets the activity ID on the current thread. |
![]() ![]() | SetCurrentThreadActivityId(Guid, Guid%) | [This topic is preliminary and is subject to change.] Sets the activity ID on the current thread, and returns the previous activity ID. |
![]() ![]() | ToString | Obtains a string representation of the current event source instance. (Overrides Object::ToString().) |
![]() ![]() | WriteEvent(Int32) | Writes an event by using the provided event identifier. |
![]() ![]() | WriteEvent(Int32, Int32) | Writes an event by using the provided event identifier and 32-bit integer argument. |
![]() ![]() | WriteEvent(Int32, Int64) | Writes an event by using the provided event identifier and 64-bit integer argument. |
![]() ![]() | WriteEvent(Int32, array<Object>) | Writes an event by using the provided event identifier and array of arguments. |
![]() ![]() | WriteEvent(Int32, String) | Writes an event by using the provided event identifier and string argument. |
![]() ![]() | WriteEvent(Int32, Int32, Int32) | Writes an event by using the provided event identifier and 32-bit integer arguments. |
![]() ![]() | WriteEvent(Int32, Int64, Int64) | Writes an event by using the provided event identifier and 64-bit arguments. |
![]() ![]() | WriteEvent(Int32, String, Int32) | Writes an event by using the provided event identifier and arguments. |
![]() ![]() | WriteEvent(Int32, String, Int64) | Writes an event by using the provided event identifier and arguments. |
![]() ![]() | WriteEvent(Int32, String, String) | Writes an event by using the provided event identifier and string arguments. |
![]() ![]() | WriteEvent(Int32, Int32, Int32, Int32) | Writes an event by using the provided event identifier and 32-bit integer arguments. |
![]() ![]() | WriteEvent(Int32, Int64, Int64, Int64) | Writes an event by using the provided event identifier and 64-bit arguments. |
![]() ![]() | WriteEvent(Int32, String, Int32, Int32) | Writes an event by using the provided event identifier and arguments. |
![]() ![]() | WriteEvent(Int32, String, String, String) | Writes an event by using the provided event identifier and string arguments. |
![]() ![]() | WriteEventCore | Creates a new WriteEvent overload by using the provided event identifier and event data. |
![]() | WriteEventWithRelatedActivityId | [This topic is preliminary and is subject to change.] Writes an event that indicates that the current activity is related to another activity. |
![]() | WriteEventWithRelatedActivityIdCore | [This topic is preliminary and is subject to change.] Writes an event that indicates that the current activity is related to another activity. |
This class is intended to be inherited by a user class that provides specific events to be used for ETW. The EventSource::WriteEvent methods are called to log the events.
The basic functionality of EventSource is sufficient for most applications. If you want more control over the ETW manifest that is created, you can apply the EventAttribute attribute to the methods. For advanced event source applications, it is possible to intercept the commands being sent to the derived event source and change the filtering, or to cause actions (such as dumping a data structure) to be performed by the inheritor. An event source can be activated with Windows ETW controllers, such as the Logman tool, immediately. It is also possible to programmatically control and intercept the data dispatcher. The EventListener class provides additional functionality.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.gif?cs-save-lang=1&cs-lang=cpp)
.png?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)