Aggiunto NLog

This commit is contained in:
Annamaria Sassi
2026-02-05 10:50:56 +01:00
parent 62d9d2f5c8
commit 5db36307da
7 changed files with 87 additions and 2 deletions
+7
View File
@@ -1,6 +1,7 @@
using EgwCoreLib.Lux.Data.Services;
using Microsoft.Extensions.Configuration;
using NLog;
using NLog.Web;
using StackExchange.Redis;
using System.Reflection;
using Test.UI.Client.Pages;
@@ -10,7 +11,12 @@ var builder = WebApplication.CreateBuilder(args);
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString();
var logger = LogManager.Setup()
.LoadConfigurationFromAppSettings()
.GetCurrentClassLogger();
ConfigurationManager configuration = builder.Configuration;
logger.Info("Program.cs: startup");
// Add services to the container.
builder.Services.AddRazorComponents()
@@ -36,6 +42,7 @@ var app = builder.Build();
// aggiunt base URL x routing corretto
string baseUrl = configuration.GetValue<string>("ServerConf:BaseUrl") ?? "";
app.UsePathBase(baseUrl);
logger.Info($"BaseUrl: {baseUrl}");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())