ActivitySource.HasListeners Method

Definition

Checks if there are any listeners for this activity source.

C#
public bool HasListeners();

Returns

true if there is a listener registered for this activity source; otherwise, false.

Applies to

Product Versions
.NET 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)