Closed zinov closed 2 years ago
This can be configure with Serilog where Configuration is an IConfiguration
var builder = new ConfigurationBuilder(); builder.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: true); Configuration = builder.Build();
Log.Logger = new LoggerConfiguration() .ReadFrom.Configuration(Configuration) .CreateLogger();
How is appsettings.json configuration working with your LoggerConfiguration? how do you pass to the LoggerConfiguration constructor the DatadogLogs config that is below (copied and pasted from your documentation)
"Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.Datadog.Logs" ], "MinimumLevel": "Debug", "WriteTo": [ { "Name": "Console" }, { "Name": "DatadogLogs", "Args": { "apiKey": "",
"source": "",
"host": "",
"tags": [":", ":"],
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"Properties": {
"Application": "Sample"
}
}