Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

LoggerFactory Class

Definition

Namespace:
Microsoft.Extensions.Logging
Assembly:
Microsoft.Extensions.Logging.dll
Package:
Microsoft.Extensions.Logging v11.0.0-preview.5.26302.115
Source:
LoggerFactory.cs
Source:
LoggerFactory.cs
Source:
LoggerFactory.cs
Source:
LoggerFactory.cs

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.

Produces instances of ILogger classes based on the given providers.

public ref class LoggerFactory : IDisposable, Microsoft::Extensions::Logging::ILoggerFactory
public class LoggerFactory : IDisposable, Microsoft.Extensions.Logging.ILoggerFactory
type LoggerFactory = class
 interface ILoggerFactory
 interface IDisposable
Public Class LoggerFactory
Implements IDisposable, ILoggerFactory
Inheritance
LoggerFactory
Implements

Constructors

Name Description
LoggerFactory()

Creates a new LoggerFactory instance.

LoggerFactory(IEnumerable<ILoggerProvider>, IOptionsMonitor<LoggerFilterOptions>, IOptions<LoggerFactoryOptions>, IExternalScopeProvider)

Creates a new LoggerFactory instance.

LoggerFactory(IEnumerable<ILoggerProvider>, IOptionsMonitor<LoggerFilterOptions>, IOptions<LoggerFactoryOptions>)

Creates a new LoggerFactory instance.

LoggerFactory(IEnumerable<ILoggerProvider>, IOptionsMonitor<LoggerFilterOptions>)

Creates a new LoggerFactory instance.

LoggerFactory(IEnumerable<ILoggerProvider>, LoggerFilterOptions)

Creates a new LoggerFactory instance.

LoggerFactory(IEnumerable<ILoggerProvider>)

Creates a new LoggerFactory instance.

Methods

Name Description
AddProvider(ILoggerProvider)

Adds the given provider to those used in creating ILogger instances.

CheckDisposed()

Check if the factory has been disposed.

Create(Action<ILoggingBuilder>)

Creates new instance of ILoggerFactory configured using provided configure delegate.

CreateLogger(String)

Creates an ILogger with the given categoryName.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Extension Methods

Name Description
CreateLogger(ILoggerFactory, Type)

Creates a new ILogger instance using the full name of the given type.

CreateLogger<T>(ILoggerFactory)

Creates a new ILogger instance using the full name of the given type.

Applies to


Feedback

Was this page helpful?