Skip to content

afaq-khan/LogzioNLogExtensions

Repository files navigation

Logzio.NLog.Extensions

.NET Quality Gate Status Nuget

A logging extension to simplify configuration of Logz.io's NLog package for sending log entries to Logz.io

Install the package from the Package Manager Console:

Install-Package Logzio.NLog.Extensions

Configuration

appsettings.json

{
  "Logging": {
    "LogLevel": {
      "Default": "__Logging.LogLevel.Default__"
    },
    "LogzioNLog": {
      "Options": {
        "Name": "__LogzioNLog.Options.Name__",
        "Token": "__LogzioNLog.Options.Token__",
        "LogzioType": "__LogzioNLog.Options.LogzioType__",
        "ListenerUrl": "__LogzioNLog.Options.ListenerUrl__",
        "BufferSize": "__LogzioNLog.Options.BufferSize__",
        "BufferTimeout": "__LogzioNLog.Options.BufferTimeout__",
        "RetriesMaxAttempts": "__LogzioNLog.Options.RetriesMaxAttempts__",
        "RetriesInterval": "__LogzioNLog.Options.RetriesInterval__",
        "Debug": "__LogzioNLog.Options.Debug__",
        "JsonKeysCamelCase": "__LogzioNLog.Options.JsonKeysCamelCase__"
      }
    }
  }
}

Code

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddLogging(loggingBuilder =>
    loggingBuilder.AddLogzioNLog(builder.Configuration.GetSection("Logging").GetSection("LogzioNLog")
        .GetSection("Options")));

About

A logging extension to simplify configuration of Logzio's NLog package for sending log entries to Logz.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages