Class LdMicrosoftLogging
Provides integration between the LaunchDarkly SDK's logging framework and
the Microsoft.Extensions.Logging
API.
Inherited Members
Namespace: LaunchDarkly.Logging
Assembly: LaunchDarkly.Logging.Microsoft.dll
Syntax
public static class LdMicrosoftLogging
Methods
| Edit this page View SourceAdapter(ILoggerFactory)
A logging implementation that delegates to the Microsoft.Extensions.Logging
framework.
Declaration
public static ILogAdapter Adapter(ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | the factory object for Microsoft logging |
Returns
Type | Description |
---|---|
ILogAdapter | a logging adapter |
Remarks
This method is only available when your target framework is .NET Core. It causes
the LaunchDarkly.Logging
APIs to delegate to the Microsoft.Extensions.Logging
framework. The ILoggerFactory
is the main configuration object for
Microsoft.Extensions.Logging
; application code can construct it programmatically,
or can obtain it by dependency injection. For more information, see
Logging
in .NET Core and ASP.NET Core.
The Microsoft.Extensions.Logging
framework has its own mechanisms for filtering log
output by level or other criteria. If you add a level filter with
LaunchDarkly.Logging.ILogAdapterExtensions.Level(LaunchDarkly.Logging.ILogAdapter, LaunchDarkly.Logging.LogLevel), it will filter
out messages below that level before they reach the Microsoft logger.