Class LdLog4net
Provides integration between the LaunchDarkly SDK's logging framework and
the log4net
framework.
Inheritance
Namespace: LaunchDarkly.Logging
Assembly: LaunchDarkly.Logging.Log4net.dll
Syntax
public static class LdLog4net : Object
Properties
Adapter
Returns an adapter for directing LaunchDarkly.Logging
output to
log4net
.
Declaration
public static ILogAdapter Adapter { get; }
Property Value
Type | Description |
---|---|
LaunchDarkly.Logging.ILogAdapter | an |
Remarks
Using this adapter will cause LaunchDarkly.Logging
to delegate each
logger it creates to a corresponding logger created with
log4net.LogManager.GetLogger
. What happens to the log output then is
entirely determined by the log4net
configuration; there are no
configuration methods on the Adapter
itself. The logger names that are
used within the LaunchDarkly.Logging
framework are passed along as
logger names to log4net
, so they can be used in filtering rules, etc.
The example code below shows how to configure the LaunchDarkly SDK to
use log4net
.
Examples
using LaunchDarkly.Logging;
using LaunchDarkly.Sdk.Server;
var config = Configuration.Builder("my-sdk-key")
.Logging(LdLog4net.Adapter)
.Build();
var client = new LdClient(config);