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
{
"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__"
}
}
}
}
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddLogging(loggingBuilder =>
loggingBuilder.AddLogzioNLog(builder.Configuration.GetSection("Logging").GetSection("LogzioNLog")
.GetSection("Options")));