Skip to content

InMemoryLoggerProvider Methods

A logger provider that buffers log messages in-memory for later retrieval. Useful for tests where logs need to be attached to test results conditionally.

CreateLogger(string)

View source
public ILogger CreateLogger(string categoryName)
Creates a new Microsoft.Extensions.Logging.ILogger instance.

Parameters

categoryNamestring
The category name for messages produced by the logger.

Returns

The instance of Microsoft.Extensions.Logging.ILogger that was created.

Dispose

View source
public void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.