Class LdNLog
- Namespace
- LaunchDarkly.Logging
- Assembly
- LaunchDarkly.Logging.NLog.dll
Provides integration between the LaunchDarkly SDK's logging framework and
the NLog
framework.
public static class LdNLog
- Inheritance
-
LdNLog
- Inherited Members
Properties
Adapter
Returns an adapter for directing LaunchDarkly.Logging
output to
NLog
.
public static ILogAdapter Adapter { get; }
Property Value
- ILogAdapter
an
ILogAdapter
that delegates toNLog
Examples
using LaunchDarkly.Logging;
using LaunchDarkly.Sdk.Server;
var config = Configuration.Builder("my-sdk-key")
.Logging(LdNLog.Adapter)
.Build();
var client = new LdClient(config);
Remarks
Using this adapter will cause LaunchDarkly.Logging
to delegate each
logger it creates to a corresponding logger created with
NLog.LogManager.GetLogger
. What happens to the log output then is
entirely determined by the NLog
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 NLog
, so they can be used in filtering rules, etc.
The example code below shows how to configure the LaunchDarkly SDK to
use NLog
.