Enhance logging configuration in Program.cs
Initialized logging by clearing providers, setting minimum level to Trace, and configuring NLog as the logging provider.
This commit is contained in:
parent
23e73aae19
commit
6ade388cd7
@ -10,6 +10,10 @@ try
|
|||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
||||||
|
builder.Host.UseNLog();
|
||||||
|
|
||||||
// Make sure to add the Ocelot configuration file
|
// Make sure to add the Ocelot configuration file
|
||||||
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
||||||
builder.Configuration.AddJsonFile($"ocelot{suffix}.json");
|
builder.Configuration.AddJsonFile($"ocelot{suffix}.json");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user