log4net.Logit 1.0.80

dotnet add package log4net.Logit --version 1.0.80
                    
NuGet\Install-Package log4net.Logit -Version 1.0.80
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="log4net.Logit" Version="1.0.80" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="log4net.Logit" Version="1.0.80" />
                    
Directory.Packages.props
<PackageReference Include="log4net.Logit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add log4net.Logit --version 1.0.80
                    
#r "nuget: log4net.Logit, 1.0.80"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package log4net.Logit@1.0.80
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=log4net.Logit&version=1.0.80
                    
Install as a Cake Addin
#tool nuget:?package=log4net.Logit&version=1.0.80
                    
Install as a Cake Tool

Logit.io Log4Net Appender

A high-performance log4net appender for sending logs to Logit.io logging platform. This appender provides asynchronous logging with configurable buffering, automatic retries, and compression to ensure reliable log delivery without impacting your application's performance.

Features

  • Asynchronous Processing: Non-blocking log operations keep your application responsive
  • Buffered Logging: Configurable queue size to handle burst logging without performance impact
  • Automatic Retries: Built-in retry mechanism with exponential backoff for network issues
  • Compression: Logs are GZIP compressed before transmission to reduce bandwidth
  • Easy Configuration: Simple XML configuration in your log4net config
  • Multi-Target Support: Supports .NET Standard 2.1, .NET 5.0, 6.0, 7.0, 8.0, and 9.0

Installation

Install the NuGet package:

dotnet add package Logit.Log4Net

Or add to your .csproj:

<PackageReference Include="Logit.Log4Net" Version="*" />

Supported Frameworks

  • .NET Standard 2.1
  • .NET 5.0
  • .NET 6.0
  • .NET 7.0
  • .NET 8.0
  • .NET 9.0

The NuGet package is multi-targeted and works with any of the above frameworks. .NET 5.0 and .NET Standard 2.1 require compatible SDKs for build and test.

For CI/CD or local builds, use:

FROM mcr.microsoft.com/dotnet/sdk:8.0

This image supports .NET Standard 2.1, .NET 5.0, 6.0, 7.0, 8.0, and 9.0.

Configuration

Basic Configuration

Add the LogitAppender to your log4net.config or App.config:

<log4net>
  <appender name="LogitAppender" type="Logit.Log4Net.LogitAppender, Logit.Log4Net">
    <param name="Token" value="your-logit-token" />
    <param name="ApiEndpoint" value="https://api.logit.io" />
    <param name="QueueSize" value="1000" />
    <param name="MinDelay" value="100" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
  </appender>

  <root>
    <level value="INFO" />
    <appender-ref ref="LogitAppender" />
  </root>
</log4net>

Configuration Parameters

Parameter Description Default Required
Token Your Logit.io API token - Yes
ApiEndpoint Logit.io API endpoint https://api.logit.io No
QueueSize Maximum number of messages in the buffer 1000 No
MinDelay Minimum delay between retries (ms) 100 No

Using with Microsoft.Extensions.Configuration

If you're using dependency injection and Microsoft.Extensions.Configuration, you can configure the appender programmatically:

// In your startup/configuration
var config = new ConfigurationBuilder()
    .AddInMemoryCollection(new Dictionary<string, string>
    {
        ["Logit:Token"] = "your-logit-token",
        ["Logit:ApiEndpoint"] = "https://api.logit.io",
        ["Logit:QueueSize"] = "1000",
        ["Logit:MinDelay"] = "100"
    })
    .Build();

// The LogitAppender will automatically read from IConfiguration

Usage

Once configured, use log4net as usual:

using log4net;

public class MyClass
{
    private static readonly ILog Log = LogManager.GetLogger(typeof(MyClass));

    public void DoSomething()
    {
        Log.Info("This message will be sent to Logit.io");
        Log.Error("Error messages are also supported", new Exception("Something went wrong"));
    }
}

Performance Considerations

  • Asynchronous: All logging operations are non-blocking
  • Buffered: Messages are queued and sent in batches
  • Compressed: Logs are GZIP compressed to reduce bandwidth
  • Retry Logic: Failed requests are automatically retried with exponential backoff

Troubleshooting

Common Issues

  1. Messages not appearing in Logit.io

    • Verify your API token is correct
    • Check network connectivity to api.logit.io
    • Ensure the appender is properly configured in your log4net config
  2. Performance issues

    • Increase QueueSize if you're experiencing high log volume
    • Monitor memory usage if queue size is very large
  3. Connection errors

    • The appender automatically retries failed requests
    • Check your firewall/proxy settings if using corporate networks

Debugging

Enable log4net internal logging to debug configuration issues:

<log4net>
  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
  </appender>

  <root>
    <level value="DEBUG" />
    <appender-ref ref="ConsoleAppender" />
  </root>
</log4net>

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support and questions:

Contributing

Contributions are welcome! Please feel free to contact us.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.80 239 7/17/2025
1.0.62 215 7/17/2025
1.0.27 211 7/16/2025
0.1.5 7,422 10/9/2014