9670e170f2
- cambio livello logging x tracciare meglio funzionamento eventi - modifica modalità serializzazione TSData (nuovo costruttore) x ridurre dimensione cache redis (circa -40%)
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GWMS.UI
|
|
{
|
|
public class Program
|
|
{
|
|
#region Public Methods
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
Host.CreateDefaultBuilder(args)
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
{
|
|
webBuilder.UseStartup<Startup>();
|
|
})
|
|
.ConfigureLogging(logging =>
|
|
{
|
|
logging.ClearProviders();
|
|
#if DEBUG
|
|
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Debug);
|
|
//logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information);
|
|
#else
|
|
|
|
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information);
|
|
//logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Warning);
|
|
#endif
|
|
});
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
var Log = LogManager.GetCurrentClassLogger();
|
|
try
|
|
{
|
|
Log.Info("GMWS.UI Application Starting Up");
|
|
CreateHostBuilder(args).Build().Run();
|
|
}
|
|
catch (Exception exception)
|
|
{
|
|
Log.Error(exception, "Stopped GMWS.UI program because of exception");
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
LogManager.Shutdown();
|
|
}
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |