EventProvider Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Use this class to write events.
public ref class EventProvider : IDisposable
public class EventProvider : IDisposable
type EventProvider = class
interface IDisposable
Public Class EventProvider
Implements IDisposable
- Inheritance
-
EventProvider
- Implements
Remarks
To consume events written using the WriteEvent and WriteTransferEvent methods, the events must be defined in a manifest; events written using the WriteMessageEvent method do not require a manifest.
Events can contain the following managed data types:
bool
Boolean
byte
char
decimal
double
float
Guid
int
IntPtr
long
sbyte
short
string
uint
UInt64
If an event in your manifest uses the Boolean
in-type, you cannot write the data element using a Boolean
data type in your managed code. The Boolean
in-type in your manifest expects a 4-byte value, and a Boolean
data type in managed code is 1-byte. Instead, you must use an int
data type to write the value. If you want to log a Boolean
value, use the UInt8 in-type in your manifest.
Constructors
EventProvider(Guid) |
Initializes a new instance of the EventProvider class. |
Methods
Close() |
Removes the provider's registration from the ETW subsystem and releases all unmanaged resources. |
CreateActivityId() |
Creates a unique activity identifier for the provider. |
Dispose() |
Releases the resources used by this EventProvider object. |
Dispose(Boolean) |
Releases the resources used by this EventProvider object. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize() |
Frees resources and performs internal cleanup before the instance is reclaimed by garbage collection. |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetLastWriteEventError() |
Gets the last error associated with an event write failure. |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
IsEnabled() |
Determines whether any session enabled the provider, regardless of the level and keyword values used to enable the provider. |
IsEnabled(Byte, Int64) |
Determines whether any session is requesting the specified event from the provider. |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
SetActivityId(Guid) |
Sets the current activity identifier used by the WriteEvent methods. |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
WriteEvent(EventDescriptor, Int32, IntPtr) |
Writes an event. The event data is specified as a block of memory. |
WriteEvent(EventDescriptor, Object[]) |
Writes an event. The event data is specified as an array of objects. |
WriteEvent(EventDescriptor, String) |
Writes an event. The event data is specified as a string. |
WriteMessageEvent(String, Byte, Int64) |
Writes an event that contains a string as its data if the level and keyword value match the events requested by the session. |
WriteMessageEvent(String) |
Writes an event that contains a string as its data. |
WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr) |
Links events together when tracing events in an end-to-end scenario. The event data is specified as a block of memory. |
WriteTransferEvent(EventDescriptor, Guid, Object[]) |
Links events together when tracing events in an end-to-end scenario. The event data is specified as an array of objects. |