FakeHostingExtensions.GetFakeLogCollector(IHost) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets the object that collects log records sent to the fake logger.

C#
public static Microsoft.Extensions.Logging.Testing.FakeLogCollector GetFakeLogCollector(this Microsoft.Extensions.Hosting.IHost host);

Parameters

host
IHost

An IHost instance.

Returns

The collector that tracks records logged to fake loggers.

Exceptions

No collector exists in the provider.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)