From 6bbc8b6fa01fb72fecb87c6ccf68f756206a85d9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 4 Jun 2024 17:53:00 +0200 Subject: [PATCH] Update livello minimo log a debug --- GWMS.UI/Controllers/IOBController.cs | 6 ++-- GWMS.UI/Controllers/PlantDataController.cs | 4 +-- GWMS.UI/Data/GWMSDataService.cs | 38 +++++++++++----------- GWMS.UI/GWMS.UI.csproj | 2 +- GWMS.UI/NLog.config | 4 +-- GWMS.UI/NLog.config.dev | 4 +-- GWMS.UI/NLog.config.rel | 4 +-- GWMS.UI/Program.cs | 5 +-- GWMS.UI/Startup.cs | 8 ----- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 12 files changed, 37 insertions(+), 44 deletions(-) diff --git a/GWMS.UI/Controllers/IOBController.cs b/GWMS.UI/Controllers/IOBController.cs index 6263802..08f683b 100644 --- a/GWMS.UI/Controllers/IOBController.cs +++ b/GWMS.UI/Controllers/IOBController.cs @@ -348,14 +348,14 @@ namespace GWMS.UI.Controllers { // conversione dati List plData = rawData.fluxData.Select(jpl => _DataService.convertFluxToPL(currPlant.PlantId, jpl)).ToList(); - Log.Trace($"flogJson | {id} | Convertiti {plData.Count} record"); + Log.Debug($"flogJson | {id} | Convertiti {plData.Count} record"); // insert! fatto = await _DataService.PlantLogInsert(plData); - Log.Trace($"flogJson | {id} | PlantLogInsert --> esito: {fatto}"); + Log.Debug($"flogJson | {id} | PlantLogInsert --> esito: {fatto}"); // effettuo SEMPRE verifica per ricalcolo ordini... await _DataService.checkLevels(); - Log.Trace($"flogJson | {id} | chiamata checkLevels"); + Log.Debug($"flogJson | {id} | chiamata checkLevels"); // leggo parametri correnti... try { diff --git a/GWMS.UI/Controllers/PlantDataController.cs b/GWMS.UI/Controllers/PlantDataController.cs index c5fe329..cb21d37 100644 --- a/GWMS.UI/Controllers/PlantDataController.cs +++ b/GWMS.UI/Controllers/PlantDataController.cs @@ -54,7 +54,7 @@ namespace GWMS.UI.Controllers [HttpGet] public async Task> Get() { - Log.Trace("PlantData: Chiamata Get"); + Log.Debug("PlantData: Chiamata Get"); // serializzo i dati di PlantDTO dell'impianto richiesto List ListRecords = await _DataService.PlantDtoGetAll(); return ListRecords; @@ -64,7 +64,7 @@ namespace GWMS.UI.Controllers [HttpGet("{id}")] public async Task Get(int id) { - Log.Trace($"PlantData: Chiamata Get | id: {id}"); + Log.Debug($"PlantData: Chiamata Get | id: {id}"); // serializzo i dati di PlantDTO dell'impianto richiesto var ListRecords = await _DataService.PlantDtoGetAll(); //seleziono plant... diff --git a/GWMS.UI/Data/GWMSDataService.cs b/GWMS.UI/Data/GWMSDataService.cs index 6c44e2c..d9d7fc7 100644 --- a/GWMS.UI/Data/GWMSDataService.cs +++ b/GWMS.UI/Data/GWMSDataService.cs @@ -218,7 +218,7 @@ namespace GWMS.UI.Data var dbResult = dbController.AlarmLogGetFilt(PlantId, skipRec, numRec); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB AlarmLogGetFilt: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB AlarmLogGetFilt: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -342,7 +342,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per ConfigGetAll: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per ConfigGetAll: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -505,7 +505,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per ItemsGetAll: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per ItemsGetAll: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -621,7 +621,7 @@ namespace GWMS.UI.Data dbResult = dbController.GetOrderByCode(OrderCode); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per OrderGetByCode: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per OrderGetByCode: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -635,7 +635,7 @@ namespace GWMS.UI.Data dbResult = dbController.GetOrderById(OrderId); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per OrderGetById: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per OrderGetById: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -649,7 +649,7 @@ namespace GWMS.UI.Data dbResult = dbController.GetOrdersFilt(CurrFilter.PlantId, CurrFilter.SupplierId, CurrFilter.TransporterId, CurrFilter.DateStart, CurrFilter.DateEnd, CurrFilter.ShowClosed); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per OrdersGetFilt: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per OrdersGetFilt: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -668,7 +668,7 @@ namespace GWMS.UI.Data dbResult = dbController.GetOrdersOpen(PlantId); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per OrdersGetOpen | PlantId: {PlantId} | {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per OrdersGetOpen | PlantId: {PlantId} | {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -728,7 +728,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per ParamSendGetAll: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per ParamSendGetAll: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -818,7 +818,7 @@ namespace GWMS.UI.Data dbResult = dbController.ParamSetGet(PlantId, ParamUid); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per ParamSetGetByPlant: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per ParamSetGetByPlant: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -938,7 +938,7 @@ namespace GWMS.UI.Data } else { - Log.Trace($"Veto attivo per PlantDtoGetAll: salto!"); + Log.Debug($"Veto attivo per PlantDtoGetAll: salto!"); // controllo se ci sia semaforo lettura redVeto = await distributedCache.GetAsync(cacheVetoKey); // se scaduto da oltre 10 sec --> tolgo @@ -958,7 +958,7 @@ namespace GWMS.UI.Data { rawData = Encoding.UTF8.GetString(redisDataList); dbResult = JsonConvert.DeserializeObject>(rawData); - Log.Trace($"PlantDtoGetAll: lettura da cache REDIS"); + Log.Debug($"PlantDtoGetAll: lettura da cache REDIS"); } else { @@ -1013,7 +1013,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantLogGetFilt: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantLogGetFilt: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -1074,7 +1074,7 @@ namespace GWMS.UI.Data // invalido i vari valori in cache await distributedCache.RemoveAsync($"DATA:PLANTS:LastFlux:{PlantId}"); await distributedCache.RemoveAsync($"DATA:PLANTS:ListDTO"); - Log.Trace($"PlantLogInsert | PlantId: {PlantId} | Completato insert {item2insert.Count} rec"); + Log.Debug($"PlantLogInsert | PlantId: {PlantId} | Completato insert {item2insert.Count} rec"); } // restituisco @@ -1102,7 +1102,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantsAnalisysGetByCode: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantsAnalisysGetByCode: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -1149,7 +1149,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantsList: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantsList: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -1352,7 +1352,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantDtoGetAll: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantDtoGetAll: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -1392,7 +1392,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantDtoGetAll: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantDtoGetAll: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(dbResult); } @@ -1551,7 +1551,7 @@ namespace GWMS.UI.Data dbResult = dbController.GetWeekPlan(); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per WeekPlanGet: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB per WeekPlanGet: {ts.TotalMilliseconds} ms"); return await Task.FromResult(dbResult); } @@ -1749,7 +1749,7 @@ namespace GWMS.UI.Data await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true)); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB + caching per PlantLogGetLastByFlux: {ts.TotalMilliseconds} ms"); + Log.Debug($"Effettuata lettura da DB + caching per PlantLogGetLastByFlux: {ts.TotalMilliseconds} ms"); } return await Task.FromResult(lastValues); } diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index fabb2d6..9f7f766 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.2406.0412 + 1.0.2406.0417 95c9f021-52d1-4390-a670-5810b7b777b0 true true diff --git a/GWMS.UI/NLog.config b/GWMS.UI/NLog.config index ab08a88..fbea809 100644 --- a/GWMS.UI/NLog.config +++ b/GWMS.UI/NLog.config @@ -29,7 +29,7 @@ layout="${longdate} ${uppercase:${level}} ${message}" /> --> - + @@ -39,7 +39,7 @@ Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" --> - + diff --git a/GWMS.UI/NLog.config.dev b/GWMS.UI/NLog.config.dev index ab08a88..fbea809 100644 --- a/GWMS.UI/NLog.config.dev +++ b/GWMS.UI/NLog.config.dev @@ -29,7 +29,7 @@ layout="${longdate} ${uppercase:${level}} ${message}" /> --> - + @@ -39,7 +39,7 @@ Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" --> - + diff --git a/GWMS.UI/NLog.config.rel b/GWMS.UI/NLog.config.rel index 8fc7637..c82b88a 100644 --- a/GWMS.UI/NLog.config.rel +++ b/GWMS.UI/NLog.config.rel @@ -29,7 +29,7 @@ layout="${longdate} ${uppercase:${level}} ${message}" /> --> - + @@ -39,7 +39,7 @@ Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" --> - + diff --git a/GWMS.UI/Program.cs b/GWMS.UI/Program.cs index 230618d..1a42dc3 100644 --- a/GWMS.UI/Program.cs +++ b/GWMS.UI/Program.cs @@ -24,7 +24,8 @@ namespace GWMS.UI .ConfigureLogging(logging => { logging.ClearProviders(); - logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); + logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information); + //logging.AddConsole(); }) .UseNLog(); @@ -40,7 +41,7 @@ namespace GWMS.UI // sistemazione NLog da codice... LogManager.Setup().LoadConfiguration(builder => { - builder.ForLogger().FilterMinLevel(NLog.LogLevel.Trace).WriteToConsole(layout: "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"); + builder.ForLogger().FilterMinLevel(NLog.LogLevel.Debug).WriteToConsole(layout: "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"); builder.ForLogger().FilterMinLevel(NLog.LogLevel.Debug).WriteToFile(layout: "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}", fileName: "${basedir}/logs/App_${shortdate}.log"); }); var logger = LogManager.GetCurrentClassLogger(); diff --git a/GWMS.UI/Startup.cs b/GWMS.UI/Startup.cs index 16b2cec..4b759ee 100644 --- a/GWMS.UI/Startup.cs +++ b/GWMS.UI/Startup.cs @@ -2,16 +2,12 @@ using GWMS.Data; using GWMS.UI.Areas.Identity; using GWMS.UI.Data; using HealthChecks.UI.Client; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Identity.UI; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Localization; using Microsoft.EntityFrameworkCore; @@ -19,12 +15,8 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Hosting; -using NLog; using System; -using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Threading.Tasks; namespace GWMS.UI { diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 009b4f3..6bb283c 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2406.0412

+

Versione: 1.0.2406.0417


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 38aaee0..34a6dd6 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2406.0412 +1.0.2406.0417 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 39c2371..9fa21e8 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2406.0412 + 1.0.2406.0417 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false