aggiunti log
This commit is contained in:
parent
a4190cc8d5
commit
250c4a44d3
@ -8,6 +8,14 @@
|
|||||||
<targets>
|
<targets>
|
||||||
<target name="file" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
|
<target name="file" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
|
||||||
<target xsi:type="File" fileName="${basedir}/logs/${level}.txt" />
|
<target xsi:type="File" fileName="${basedir}/logs/${level}.txt" />
|
||||||
|
</target>
|
||||||
|
<target name="console" xsi:type="ColoredConsole"
|
||||||
|
layout="${time} [${level:uppercase=true}] ${logger}: ${message} ${exception:format=tostring}">
|
||||||
|
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" />
|
||||||
|
<highlight-row condition="level == LogLevel.Info" foregroundColor="Gray" />
|
||||||
|
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
||||||
|
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
||||||
|
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" backgroundColor="White" />
|
||||||
</target>
|
</target>
|
||||||
<target name="database"
|
<target name="database"
|
||||||
xsi:type="Database"
|
xsi:type="Database"
|
||||||
@ -27,6 +35,6 @@
|
|||||||
</target>
|
</target>
|
||||||
</targets>
|
</targets>
|
||||||
<rules>
|
<rules>
|
||||||
<logger name="*" minlevel="Debug" writeTo="database" />
|
<logger name="*" minlevel="Debug" writeTo="file,console" />
|
||||||
</rules>
|
</rules>
|
||||||
</nlog>
|
</nlog>
|
@ -216,6 +216,7 @@ namespace PDFGenerator.BusinessLayer
|
|||||||
var DataThreadsDT = (new SQLServer()).GetDataTableFromProcedure(CACHE.QueryContratti, pars);
|
var DataThreadsDT = (new SQLServer()).GetDataTableFromProcedure(CACHE.QueryContratti, pars);
|
||||||
if (DataThreadsDT != null && DataThreadsDT.Rows.Count > 0)
|
if (DataThreadsDT != null && DataThreadsDT.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
|
logger.Info($"Query contratti completata con successo. Trovate {DataThreadsDT.Rows.Count} righe");
|
||||||
ret = new List<DataThread>();
|
ret = new List<DataThread>();
|
||||||
foreach (DataRow r in DataThreadsDT.Rows)
|
foreach (DataRow r in DataThreadsDT.Rows)
|
||||||
{
|
{
|
||||||
@ -225,6 +226,10 @@ namespace PDFGenerator.BusinessLayer
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.Warn($"Nessun dato trovato dalla query contratti: {CACHE.QueryContratti}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -796,7 +796,6 @@ namespace PDFGenerator
|
|||||||
if (string.IsNullOrWhiteSpace(_dataThread.NomeFilePdf))
|
if (string.IsNullOrWhiteSpace(_dataThread.NomeFilePdf))
|
||||||
{
|
{
|
||||||
logger.Info("_dataThread.NomeFilePdf è vuoto");
|
logger.Info("_dataThread.NomeFilePdf è vuoto");
|
||||||
Console.WriteLine("_dataThread.NomeFilePdf è vuoto");
|
|
||||||
_dataThread.NomeFilePdf = "Test";
|
_dataThread.NomeFilePdf = "Test";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,7 +808,8 @@ namespace PDFGenerator
|
|||||||
int counter = 1;
|
int counter = 1;
|
||||||
while (File.Exists(filePath))
|
while (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
filePath = System.IO.Path.Combine(folder, $"{fileNameBase}_{counter}.pdf");
|
_dataThread.NomeFilePdf = $"{fileNameBase}_{counter}";
|
||||||
|
filePath = System.IO.Path.Combine(folder, $"{_dataThread.NomeFilePdf}.pdf");
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user