Share via


TurnContext.TraceActivityAsync Method

Definition

Sends a trace activity to the IChannelAdapter for logging purposes.

public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> TraceActivityAsync(string name, object value = default, string valueType = default, string label = default, System.Threading.CancellationToken cancellationToken = default);
abstract member TraceActivityAsync : string * obj * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
override this.TraceActivityAsync : string * obj * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function TraceActivityAsync (name As String, Optional value As Object = Nothing, Optional valueType As String = Nothing, Optional label As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

name
String

The value to assign to the activity's Name property.

value
Object

The value to assign to the activity's Value property.

valueType
String

The value to assign to the activity's ValueType property.

label
String

The value to assign to the activity's Label property.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

If the adapter is being hosted in the Emulator, the task result contains a ResourceResponse object with the original trace activity's ID; otherwise, it contains a ResourceResponse object containing the ID that the receiving channel assigned to the activity.

Implements

Applies to