log4net.Logit
1.0.80
dotnet add package log4net.Logit --version 1.0.80
NuGet\Install-Package log4net.Logit -Version 1.0.80
<PackageReference Include="log4net.Logit" Version="1.0.80" />
<PackageVersion Include="log4net.Logit" Version="1.0.80" />
<PackageReference Include="log4net.Logit" />
paket add log4net.Logit --version 1.0.80
#r "nuget: log4net.Logit, 1.0.80"
#:package log4net.Logit@1.0.80
#addin nuget:?package=log4net.Logit&version=1.0.80
#tool nuget:?package=log4net.Logit&version=1.0.80
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.
Recommended SDK Container
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
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
Performance issues
- Increase
QueueSizeif you're experiencing high log volume - Monitor memory usage if queue size is very large
- Increase
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:
- Check the Logit.io documentation
- Open an issue on the GitHub repository
- Contact Logit.io support
Contributing
Contributions are welcome! Please feel free to contact us.
| Product | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.