LaunchDarkly Logging API for .NET - Log4net Adapter
(version 1.0.1)
This .NET package provides integration from the LaunchDarkly.Logging
API that is used by the LaunchDarkly .NET SDK, Xamarin SDK, and other LaunchDarkly libraries, to the Apache log4net framework.
This adapter is published as a separate NuGet package to avoid unwanted dependencies on log4net in the LaunchDarkly SDKs and in applications that do not use that framework.
Usage
The LdLog4net adapter is provided by the NuGet package LaunchDarkly.Logging.Log4net
. It provides integration with log4net version 2.0.6 and higher.
Log4net has a rich configuration system that allows log behavior to be controlled in many ways. The LaunchDarkly adapter does not define any specific logging behavior itself, so the actual behavior will be determined by how you have configured log4net.
To use the adapter:
Add the NuGet package
LaunchDarkly.Logging.Log4net
to your project. Make sure you also have a dependency on a compatible version of log4net.Use the property LdLog4net.Adapter in any LaunchDarkly library configuration that accepts a
LaunchDarkly.Logging.ILogAdapter
object. For instance, if you are configuring the LaunchDarkly .NET SDK:
using LaunchDarkly.Logging;
using LaunchDarkly.Sdk.Server;
var config = Configuration.Builder("my-sdk-key")
.Logging(LdLog4net.Adapter)
.Build();
var client = new LdClient(config);