LaunchDarkly Logging API for .NET - log4net Adapter
Search Results for

    Show / Hide Table of Contents

    Class LdLog4net

    Provides integration between the LaunchDarkly SDK's logging framework and the log4net framework.

    Inheritance
    object
    LdLog4net
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LaunchDarkly.Logging
    Assembly: LaunchDarkly.Logging.Log4net.dll
    Syntax
    public static class LdLog4net

    Properties

    | Edit this page View Source

    Adapter

    Returns an adapter for directing LaunchDarkly.Logging output to log4net.

    Declaration
    public static ILogAdapter Adapter { get; }
    Property Value
    Type Description
    ILogAdapter

    an ILogAdapter that delegates to log4net

    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);
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX