EventSource.Write EventSource.Write EventSource.Write EventSource.Write Method

Definition

Writes an event.

Overloads

Write(String) Write(String) Write(String) Write(String)

Writes an event without fields, but with the specified name and default options.

Write(String, EventSourceOptions) Write(String, EventSourceOptions) Write(String, EventSourceOptions) Write(String, EventSourceOptions)

Writes an event without fields, but with the specified name and options.

Write<T>(String, T) Write<T>(String, T) Write<T>(String, T) Write<T>(String, T)

Writes an event with the specified name and data.

Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T)

Writes an event with the specified name, event data and options.

Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T)

Writes an event with the specified name, options and event data.

Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T)

Writes an event with the specified name, options, related activity and event data.

Write(String) Write(String) Write(String) Write(String)

Writes an event without fields, but with the specified name and default options.

public:
 void Write(System::String ^ eventName);
public void Write (string eventName);
member this.Write : string -> unit
Public Sub Write (eventName As String)

Parameters

eventName
String String String String

The name of the event to write.

Exceptions

Write(String, EventSourceOptions) Write(String, EventSourceOptions) Write(String, EventSourceOptions) Write(String, EventSourceOptions)

Writes an event without fields, but with the specified name and options.

public:
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions options);
public void Write (string eventName, System.Diagnostics.Tracing.EventSourceOptions options);
member this.Write : string * System.Diagnostics.Tracing.EventSourceOptions -> unit
Public Sub Write (eventName As String, options As EventSourceOptions)

Parameters

eventName
String String String String

The name of the event to write.

options
EventSourceOptions EventSourceOptions EventSourceOptions EventSourceOptions

The options such as level, keywords and operation code for the event.

Exceptions

Write<T>(String, T) Write<T>(String, T) Write<T>(String, T) Write<T>(String, T)

Writes an event with the specified name and data.

public:
generic <typename T>
 void Write(System::String ^ eventName, T data);
public void Write<T> (string eventName, T data);
member this.Write : string * 'T -> unit
Public Sub Write(Of T) (eventName As String, data As T)

Type Parameters

T

The type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute.

Parameters

eventName
String String String String

The name of the event.

data

The event data. This type must be an anonymous type or marked with the EventDataAttribute attribute.

Remarks

If eventName is null, the event name is automatically derived from the type T's event data (Name) or determined based on the name of type T. The public instance properties of data will be written recursively to create the event fields.

Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T)

Writes an event with the specified name, event data and options.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions options, T data);
public void Write<T> (string eventName, System.Diagnostics.Tracing.EventSourceOptions options, T data);
member this.Write : string * System.Diagnostics.Tracing.EventSourceOptions * 'T -> unit
Public Sub Write(Of T) (eventName As String, options As EventSourceOptions, data As T)

Type Parameters

T

The type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute.

Parameters

eventName
String String String String

The name of the event.

data

The event data. This type must be an anonymous type or marked with the EventDataAttribute attribute.

Remarks

If eventName is null, the event name is automatically derived from the type T's event data (Name) or determined based on the name of type T. The public instance properties of data will be written recursively to create the event fields.

Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T) Write<T>(String, EventSourceOptions, T)

Writes an event with the specified name, options and event data.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions % options, T % data);
public void Write<T> (string eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref T data);
member this.Write : string *  *  -> unit
Public Sub Write(Of T) (eventName As String, ByRef options As EventSourceOptions, ByRef data As T)

Type Parameters

T

The type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute.

Parameters

eventName
String String String String

The name of the event.

data

The event data. This type must be an anonymous type or marked with the EventDataAttribute attribute.

Remarks

If eventName is null, the event name is automatically derived from the type T's event data (Name) or determined based on the name of type T. The public instance properties of data will be written recursively to create the event fields.

Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T) Write<T>(String, EventSourceOptions, Guid, Guid, T)

Writes an event with the specified name, options, related activity and event data.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions % options, Guid % activityId, Guid % relatedActivityId, T % data);
public void Write<T> (string eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data);
member this.Write : string *  *  *  *  -> unit
Public Sub Write(Of T) (eventName As String, ByRef options As EventSourceOptions, ByRef activityId As Guid, ByRef relatedActivityId As Guid, ByRef data As T)

Type Parameters

T

The type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute.

Parameters

eventName
String String String String

The name of the event.

activityId
Guid Guid Guid Guid

The ID of the activity associated with the event.

relatedActivityId
Guid Guid Guid Guid

The ID of an associated activity, or Empty if there is no associated activity.

data

The event data. This type must be an anonymous type or marked with the EventDataAttribute attribute.

Remarks

If eventName is null, the event name is automatically derived from the type T's event data (Name) or determined based on the name of type T. The public instance properties of data will be written recursively to create the event fields.

Applies to