- update NLog
- update nuget
This commit is contained in:
Samuele Locatelli
2024-09-04 09:40:18 +02:00
parent b351d5f521
commit 745262fd1d
6 changed files with 61 additions and 6 deletions
+4 -3
View File
@@ -22,9 +22,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="5.1.1" />
<PackageReference Include="StackExchange.Redis" Version="2.6.90" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="NLog" Version="5.3.3" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.12" />
<PackageReference Include="StackExchange.Redis" Version="2.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
</ItemGroup>
<ItemGroup>
+11
View File
@@ -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();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MP-IOC </i>
<h4>Versione: 6.16.2310.411</h4>
<h4>Versione: 6.16.2409.409</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2310.411
6.16.2409.409
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2310.411</version>
<version>6.16.2409.409</version>
<url>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+43
View File
@@ -5,6 +5,49 @@
"Microsoft.AspNetCore": "Warning"
}
},
"NLog": {
"variables": {
"baseFileDir": "${basedir}/logs/",
"layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"
},
// "internalLogLevel": "Info",
// "internalLogFile": "c:\\temp\\internal-nlog.txt",
"extensions": [
{ "assembly": "NLog.Extensions.Logging" },
{ "assembly": "NLog.Web.AspNetCore" }
],
"throwConfigExceptions": true,
"targets": {
"async": true,
"logfile": {
"type": "File",
"fileName": "${basedir}/logs/${shortdate}.log",
"archiveEvery": "Day",
"archiveFileName": "${basedir}/logs/old/${shortdate}_{#}.log",
"archiveNumbering": "DateAndSequence",
"archiveAboveSize": "1024000",
"archiveDateFormat": "HH",
"maxArchiveFiles": "60",
"maxArchiveDays": "30"
},
"logconsole": {
"type": "ColoredConsole",
"layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}"
}
},
"rules": [
{
"logger": "*",
"minLevel": "Trace",
"writeTo": "logconsole"
},
{
"logger": "*",
"minLevel": "Info",
"writeTo": "logfile"
}
]
},
"AllowedHosts": "*",
"CodApp": "MP.IOC",
"ConnectionStrings": {