ILoggerFactory Interface¶
Represents a type used to configure the logging system and create instances of Microsoft.Extensions.Logging.ILogger
from
the registered Microsoft.Extensions.Logging.ILoggerProvider
s.
- Namespace
Microsoft.Extensions.Logging
- Assemblies
- Microsoft.Extensions.Logging.Abstractions
Syntax¶
public interface ILoggerFactory : IDisposable
-
interface
Microsoft.Extensions.Logging.
ILoggerFactory
Methods¶
-
AddProvider
(Microsoft.Extensions.Logging.ILoggerProvider)¶ Adds an
Microsoft.Extensions.Logging.ILoggerProvider
to the logging system.Arguments: provider (Microsoft.Extensions.Logging.ILoggerProvider) – The Microsoft.Extensions.Logging.ILoggerProvider
.void AddProvider(ILoggerProvider provider)
-
CreateLogger
(System.String)¶ Creates a new
Microsoft.Extensions.Logging.ILogger
instance.Arguments: categoryName (System.String) – The category name for messages produced by the logger. Return type: Microsoft.Extensions.Logging.ILogger Returns: The Microsoft.Extensions.Logging.ILogger
.ILogger CreateLogger(string categoryName)
-