IOC:
- update NLog - update nuget
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.IOC.Data;
|
||||
using NLog;
|
||||
using NLog.Web;
|
||||
using StackExchange.Redis;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var logger = LogManager.Setup()
|
||||
.LoadConfigurationFromAppSettings()
|
||||
.GetCurrentClassLogger();
|
||||
logger.Info("Program.cs: startup");
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
@@ -13,6 +20,7 @@ builder.Services.AddSwaggerGen();
|
||||
|
||||
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...
|
||||
@@ -28,6 +36,7 @@ if (app.Environment.IsDevelopment() || app.Environment.IsStaging())
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
logger.Info("Added swagger");
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
@@ -39,4 +48,6 @@ app.UseStaticFiles();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
logger.Info("Run App");
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user