In This Article

ILoggerFactory Interface

Defines a factory object for creating instances of Logger.

public interface ILoggerFactory : IDisposable

Methods

CreateLogger(string)

Creates a new Logger with the given category name.

Logger? CreateLogger(string categoryName)
Parameter Type Description
categoryName string

The category name.

Returns

Logger:

A new or existing Logger for the given category, or null if logging is not configured.

CreateLogger(Type)

Creates a new Logger whose category is defined by the full name of the given Type.

Logger? CreateLogger(Type categoryType)
Parameter Type Description
categoryType Type

The type whose full name will be used as the category.

Returns

Logger:

A new or existing Logger for the given category, or null if logging is not configured.

CreateLogger<TCategory>()

Creates a new Logger whose category is defined by the full name of the given Type.

Logger? CreateLogger<TCategory>()
Type Parameters:
TCategory -

The type whose full name will be used as the category.

Returns

Logger:

A new or existing Logger for the given category, or null if logging is not configured.

Inherited Members

Extension Methods