TraceSource.TraceTransfer(Int32, String, Guid) Method

Definition

Writes a trace transfer message to the trace listeners in the Listeners collection using the specified numeric identifier, message, and related activity identifier.

C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceTransfer(int id, string? message, Guid relatedActivityId);
C#
public void TraceTransfer(int id, string message, Guid relatedActivityId);
C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceTransfer(int id, string message, Guid relatedActivityId);

Parameters

id
Int32

A numeric identifier for the event.

message
String

The trace message to write.

relatedActivityId
Guid

A structure that identifies the related activity.

Attributes

Remarks

The TraceTransfer method calls the TraceTransfer method of each trace listener in the Listeners property to write the trace information. The default TraceTransfer method in the base TraceListener class calls the TraceListener.TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) method to process the call, setting eventType to TraceEventType.Transfer and appending a string representation of the relatedActivityId GUID to message.

TraceTransfer is intended to be used with the logical operations of a CorrelationManager. The relatedActivityId parameter relates to the ActivityId property of a CorrelationManager object. If a logical operation begins in one activity and transfers to another, the second activity logs the transfer by calling the TraceTransfer method. The TraceTransfer call relates the new activity identity to the previous identity. The most likely consumer of this functionality is a trace viewer that can report logical operations that span multiple activities.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also