Configure NLog only in non-development environments

Refactored logging setup to clear providers and use NLog exclusively when not in development. This ensures development uses default logging, while production and other environments leverage NLog.
This commit is contained in:
2026-03-18 11:14:26 +01:00
parent 58f228dc6f
commit b08d88ee0f

View File

@@ -10,8 +10,11 @@ try
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
if (!builder.Environment.IsDevelopment())
{
builder.Logging.ClearProviders();
builder.Host.UseNLog();
}
builder.Services.AddControllers();
builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)