EventProvider Class

 

Use this class to write events.

Namespace:   System.Diagnostics.Eventing
Assembly:  System.Core (in System.Core.dll)

System.Object
  System.Diagnostics.Eventing.EventProvider

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public class EventProvider : IDisposable

NameDescription
System_CAPS_pubmethodEventProvider(Guid)

Initializes a new instance of the EventProvider class.

NameDescription
System_CAPS_pubmethodClose()

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

System_CAPS_pubmethodSystem_CAPS_staticCreateActivityId()

Creates a unique activity identifier for the provider.

System_CAPS_pubmethodDispose()

Releases the resources used by this EventProvider object.

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by this EventProvider object.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Frees resources and performs internal cleanup before the instance is reclaimed by garbage collection.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetLastWriteEventError()

Gets the last error associated with an event write failure.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIsEnabled()

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

System_CAPS_pubmethodIsEnabled(Byte, Int64)

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

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticSetActivityId(Guid)

Sets the current activity identifier used by the WriteEvent methods.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_protmethodWriteEvent(EventDescriptor, Int32, IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Writes an event. The event data is specified as a block of memory.

System_CAPS_pubmethodWriteEvent(EventDescriptor, Object[])

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

System_CAPS_pubmethodWriteEvent(EventDescriptor, String)

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

System_CAPS_pubmethodWriteMessageEvent(String)

Writes an event that contains a string as its data.

System_CAPS_pubmethodWriteMessageEvent(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.

System_CAPS_protmethodWriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Links events together when tracing events in an end-to-end scenario. The event data is specified as a block of memory.

System_CAPS_pubmethodWriteTransferEvent(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.

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.

.NET Framework
Available since 3.5

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: