EventProvider EventProvider EventProvider EventProvider Class

Definition

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
EventProviderEventProviderEventProviderEventProvider
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) EventProvider(Guid) EventProvider(Guid) EventProvider(Guid)

Initializes a new instance of the EventProvider class.

Methods

Close() Close() Close() Close()

Removes the provider's registration from the ETW subsystem and releases all unmanaged resources.

CreateActivityId() CreateActivityId() CreateActivityId() CreateActivityId()

Creates a unique activity identifier for the provider.

Dispose() Dispose() Dispose() Dispose()

Releases the resources used by this EventProvider object.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases the resources used by this EventProvider object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

Frees resources and performs internal cleanup before the instance is reclaimed by garbage collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLastWriteEventError() GetLastWriteEventError() GetLastWriteEventError() GetLastWriteEventError()

Gets the last error associated with an event write failure.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsEnabled() IsEnabled() IsEnabled() IsEnabled()

Determines whether any session enabled the provider, regardless of the level and keyword values used to enable the provider.

IsEnabled(Byte, Int64) IsEnabled(Byte, Int64) IsEnabled(Byte, Int64) IsEnabled(Byte, Int64)

Determines whether any session is requesting the specified event from the provider.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetActivityId(Guid) SetActivityId(Guid) SetActivityId(Guid) SetActivityId(Guid)

Sets the current activity identifier used by the WriteEvent methods.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
WriteEvent(EventDescriptor, Int32, IntPtr) WriteEvent(EventDescriptor, Int32, IntPtr) WriteEvent(EventDescriptor, Int32, IntPtr) WriteEvent(EventDescriptor, Int32, IntPtr)

Writes an event. The event data is specified as a block of memory.

WriteEvent(EventDescriptor, Object[]) WriteEvent(EventDescriptor, Object[]) WriteEvent(EventDescriptor, Object[]) WriteEvent(EventDescriptor, Object[])

Writes an event. The event data is specified as an array of objects.

WriteEvent(EventDescriptor, String) WriteEvent(EventDescriptor, String) WriteEvent(EventDescriptor, String) WriteEvent(EventDescriptor, String)

Writes an event. The event data is specified as a string.

WriteMessageEvent(String) WriteMessageEvent(String) WriteMessageEvent(String) WriteMessageEvent(String)

Writes an event that contains a string as its data.

WriteMessageEvent(String, Byte, Int64) WriteMessageEvent(String, Byte, Int64) WriteMessageEvent(String, Byte, Int64) 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.

WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr) WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr) WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr) 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[]) WriteTransferEvent(EventDescriptor, Guid, Object[]) WriteTransferEvent(EventDescriptor, Guid, Object[]) 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.

Applies to