共用方式為


GlobalBrokeredServiceContainer.GetTraceSourceForBrokeredServiceAsync Method

Definition

Gets a TraceSource to apply to some brokered service.

public System.Threading.Tasks.ValueTask<System.Diagnostics.TraceSource?> GetTraceSourceForBrokeredServiceAsync (Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, Microsoft.ServiceHub.Framework.ServiceMoniker serviceMoniker, Microsoft.ServiceHub.Framework.ServiceActivationOptions options, bool clientRole, System.Threading.CancellationToken cancellationToken);
member this.GetTraceSourceForBrokeredServiceAsync : Microsoft.ServiceHub.Framework.IServiceBroker * Microsoft.ServiceHub.Framework.ServiceMoniker * Microsoft.ServiceHub.Framework.ServiceActivationOptions * bool * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Diagnostics.TraceSource>
Public Function GetTraceSourceForBrokeredServiceAsync (serviceBroker As IServiceBroker, serviceMoniker As ServiceMoniker, options As ServiceActivationOptions, clientRole As Boolean, cancellationToken As CancellationToken) As ValueTask(Of TraceSource)

Parameters

serviceBroker
IServiceBroker

A service broker that may be used to create the TraceSource.

serviceMoniker
ServiceMoniker

The moniker of the service being requested.

options
ServiceActivationOptions

The activation options accompanying the request.

clientRole
Boolean

true if the TraceSource will be used by the client of the service; false if used by the service itself.

cancellationToken
CancellationToken

A cancellation token.

Returns

A TraceSource instance that has the appropriate verbosity and listeners preconfigured, or null if the host provides no instance.

Applies to