MON:
- update NLog config - update nuget
This commit is contained in:
@@ -2,6 +2,8 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using MP.Data;
|
||||
using MP.Data.Services;
|
||||
using NLog;
|
||||
using NLog.Web;
|
||||
using StackExchange.Redis;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -14,15 +16,24 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
|
||||
var logger = LogManager.Setup()
|
||||
.LoadConfigurationFromAppSettings()
|
||||
.GetCurrentClassLogger();
|
||||
logger.Info("Program.cs: startup");
|
||||
|
||||
ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
// REDIS setup
|
||||
logger.Info("Setup REDIS");
|
||||
string connStringRedis = configuration.GetConnectionString("Redis");
|
||||
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||
// avvio oggetto shared x redis...
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
// Add services to the container.
|
||||
logger.Info("Setup Services");
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddServerSideBlazor();
|
||||
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
|
||||
@@ -47,4 +58,5 @@ app.UseRouting();
|
||||
app.MapBlazorHub();
|
||||
app.MapFallbackToPage("/_Host");
|
||||
|
||||
logger.Info("Run App");
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user