Microsoft.Extensions.Diagnostics.Tracing.TracingBuilderExtensions
Extension methods for ITracingBuilder to add or clear ActivityListener registrations.
public static ITracingBuilder AddListener(this ITracingBuilder builder, string name, Action<ActivityListenerBuilder> configure)
Registers a new ActivityListener identified by name and described by
the supplied configure callback.
public static ITracingBuilder AddListener(this ITracingBuilder builder, string name, Action<IServiceProvider, ActivityListenerBuilder> configure)
Registers a new ActivityListener identified by name and described by
the supplied configure callback, which also receives the resolved IServiceProvider.
Removes all ActivityListenerBuilder registrations from the dependency injection container.
public static ITracingBuilder DisableTracing(this ITracingBuilder builder, string sourceName = null, string operationName = null, string listenerName = null, ActivitySourceScopes scopes = 3)
Disables all activities for the given source, operation, listener, and scopes.
public static TracingOptions DisableTracing(this TracingOptions options, string sourceName = null, string operationName = null, string listenerName = null, ActivitySourceScopes scopes = 3)
Disables all activities for the given source, operation, listener, and scopes.
public static ITracingBuilder EnableTracing(this ITracingBuilder builder, string sourceName = null, string operationName = null, string listenerName = null, ActivitySourceScopes scopes = 3)
Enables all activities for the given source, operation, listener, and scopes.
public static TracingOptions EnableTracing(this TracingOptions options, string sourceName = null, string operationName = null, string listenerName = null, ActivitySourceScopes scopes = 3)
Enables all activities for the given source, operation, listener, and scopes.