FakeHostingExtensions.GetFakeLogCollector(IHost) Method

Definition

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)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)