Fix gestione livello LOG da MAN
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<add key="autoStartProc" value="true" />
|
||||
<add key="closeOnChildUpdate" value="true" />
|
||||
<add key="targetExe" value="C:\Steamware\IOB-WIN-NEXT\IOB-WIN-NEXT.exe" />
|
||||
<add key="TargetNLogConf" value="C:\Steamware\IOB-WIN-NEXT\NLog.config" />
|
||||
<add key="BaseArg" value="MODE=MAN IOB=" />
|
||||
<!--<add key="ArgsList" value="SIMUL_00,SIMUL_00" />-->
|
||||
<add key="ArgsConfFile" value="/CONF/process.json" />
|
||||
|
||||
@@ -243,6 +243,10 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="Resources\NLog._demo.config" />
|
||||
<None Include="Resources\NLog.template.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\Test.bat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
Generated
+56
-26
@@ -57,6 +57,8 @@
|
||||
this.dgvManagedItems = new System.Windows.Forms.DataGridView();
|
||||
this.UI_Timer = new System.Windows.Forms.Timer(this.components);
|
||||
this.forceCheckTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.cbLogLevelMin = new System.Windows.Forms.ComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
@@ -70,8 +72,8 @@
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.BackColor = System.Drawing.SystemColors.WindowText;
|
||||
this.btnClose.ForeColor = System.Drawing.Color.Yellow;
|
||||
this.btnClose.Location = new System.Drawing.Point(10, 129);
|
||||
this.btnClose.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnClose.Location = new System.Drawing.Point(12, 165);
|
||||
this.btnClose.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnClose.TabIndex = 70;
|
||||
@@ -92,7 +94,7 @@
|
||||
this.lblVers,
|
||||
this.tsProgBar,
|
||||
this.tsslNumProc});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 413);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 469);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(689, 22);
|
||||
@@ -128,7 +130,7 @@
|
||||
this.panel1.Controls.Add(this.menuStrip1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(689, 31);
|
||||
this.panel1.TabIndex = 83;
|
||||
@@ -180,8 +182,8 @@
|
||||
//
|
||||
this.btnMaximixeAll.BackColor = System.Drawing.SystemColors.Highlight;
|
||||
this.btnMaximixeAll.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.btnMaximixeAll.Location = new System.Drawing.Point(11, 57);
|
||||
this.btnMaximixeAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnMaximixeAll.Location = new System.Drawing.Point(12, 95);
|
||||
this.btnMaximixeAll.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnMaximixeAll.Name = "btnMaximixeAll";
|
||||
this.btnMaximixeAll.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnMaximixeAll.TabIndex = 81;
|
||||
@@ -193,8 +195,8 @@
|
||||
//
|
||||
this.btnMinimizeAll.BackColor = System.Drawing.SystemColors.Highlight;
|
||||
this.btnMinimizeAll.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.btnMinimizeAll.Location = new System.Drawing.Point(11, 87);
|
||||
this.btnMinimizeAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnMinimizeAll.Location = new System.Drawing.Point(12, 125);
|
||||
this.btnMinimizeAll.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnMinimizeAll.Name = "btnMinimizeAll";
|
||||
this.btnMinimizeAll.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnMinimizeAll.TabIndex = 80;
|
||||
@@ -211,16 +213,18 @@
|
||||
this.tableLayoutPanel1.Controls.Add(this.dgvManagedItems, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 31);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 1;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(689, 382);
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(689, 438);
|
||||
this.tableLayoutPanel1.TabIndex = 85;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.panel2.Controls.Add(this.label1);
|
||||
this.panel2.Controls.Add(this.cbLogLevelMin);
|
||||
this.panel2.Controls.Add(this.btnStartSel);
|
||||
this.panel2.Controls.Add(this.btnMoreTOut);
|
||||
this.panel2.Controls.Add(this.txtTOutAutoCheck);
|
||||
@@ -233,9 +237,9 @@
|
||||
this.panel2.Controls.Add(this.btnMaximixeAll);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(571, 2);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(116, 378);
|
||||
this.panel2.Size = new System.Drawing.Size(116, 434);
|
||||
this.panel2.TabIndex = 85;
|
||||
//
|
||||
// btnStartSel
|
||||
@@ -243,8 +247,8 @@
|
||||
this.btnStartSel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnStartSel.BackColor = System.Drawing.Color.Green;
|
||||
this.btnStartSel.ForeColor = System.Drawing.Color.Yellow;
|
||||
this.btnStartSel.Location = new System.Drawing.Point(9, 159);
|
||||
this.btnStartSel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnStartSel.Location = new System.Drawing.Point(11, 195);
|
||||
this.btnStartSel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnStartSel.Name = "btnStartSel";
|
||||
this.btnStartSel.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnStartSel.TabIndex = 88;
|
||||
@@ -254,7 +258,7 @@
|
||||
//
|
||||
// btnMoreTOut
|
||||
//
|
||||
this.btnMoreTOut.Location = new System.Drawing.Point(81, 306);
|
||||
this.btnMoreTOut.Location = new System.Drawing.Point(81, 326);
|
||||
this.btnMoreTOut.Name = "btnMoreTOut";
|
||||
this.btnMoreTOut.Size = new System.Drawing.Size(25, 23);
|
||||
this.btnMoreTOut.TabIndex = 87;
|
||||
@@ -265,7 +269,7 @@
|
||||
//
|
||||
// txtTOutAutoCheck
|
||||
//
|
||||
this.txtTOutAutoCheck.Location = new System.Drawing.Point(11, 306);
|
||||
this.txtTOutAutoCheck.Location = new System.Drawing.Point(11, 326);
|
||||
this.txtTOutAutoCheck.Name = "txtTOutAutoCheck";
|
||||
this.txtTOutAutoCheck.Size = new System.Drawing.Size(64, 20);
|
||||
this.txtTOutAutoCheck.TabIndex = 86;
|
||||
@@ -277,7 +281,7 @@
|
||||
this.chkAutoRestart.AutoSize = true;
|
||||
this.chkAutoRestart.Checked = true;
|
||||
this.chkAutoRestart.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkAutoRestart.Location = new System.Drawing.Point(11, 275);
|
||||
this.chkAutoRestart.Location = new System.Drawing.Point(11, 295);
|
||||
this.chkAutoRestart.Name = "chkAutoRestart";
|
||||
this.chkAutoRestart.Size = new System.Drawing.Size(85, 17);
|
||||
this.chkAutoRestart.TabIndex = 85;
|
||||
@@ -290,8 +294,8 @@
|
||||
this.btnOpenAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOpenAll.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.btnOpenAll.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.btnOpenAll.Location = new System.Drawing.Point(10, 12);
|
||||
this.btnOpenAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnOpenAll.Location = new System.Drawing.Point(11, 50);
|
||||
this.btnOpenAll.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnOpenAll.Name = "btnOpenAll";
|
||||
this.btnOpenAll.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnOpenAll.TabIndex = 84;
|
||||
@@ -303,8 +307,8 @@
|
||||
//
|
||||
this.btnRestartAll.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.btnRestartAll.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.btnRestartAll.Location = new System.Drawing.Point(11, 244);
|
||||
this.btnRestartAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnRestartAll.Location = new System.Drawing.Point(11, 264);
|
||||
this.btnRestartAll.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnRestartAll.Name = "btnRestartAll";
|
||||
this.btnRestartAll.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnRestartAll.TabIndex = 83;
|
||||
@@ -316,8 +320,8 @@
|
||||
//
|
||||
this.btnCloseAll.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.btnCloseAll.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.btnCloseAll.Location = new System.Drawing.Point(11, 214);
|
||||
this.btnCloseAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnCloseAll.Location = new System.Drawing.Point(11, 234);
|
||||
this.btnCloseAll.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnCloseAll.Name = "btnCloseAll";
|
||||
this.btnCloseAll.Size = new System.Drawing.Size(96, 26);
|
||||
this.btnCloseAll.TabIndex = 82;
|
||||
@@ -338,7 +342,7 @@
|
||||
this.dgvManagedItems.Name = "dgvManagedItems";
|
||||
this.dgvManagedItems.ReadOnly = true;
|
||||
this.dgvManagedItems.RowHeadersWidth = 51;
|
||||
this.dgvManagedItems.Size = new System.Drawing.Size(563, 376);
|
||||
this.dgvManagedItems.Size = new System.Drawing.Size(563, 432);
|
||||
this.dgvManagedItems.TabIndex = 76;
|
||||
this.dgvManagedItems.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvManagedItems_CellDoubleClick);
|
||||
this.dgvManagedItems.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvManagedItems_CellFormatting);
|
||||
@@ -352,19 +356,43 @@
|
||||
this.forceCheckTimer.Interval = 5000;
|
||||
this.forceCheckTimer.Tick += new System.EventHandler(this.forceCheckTimer_Tick);
|
||||
//
|
||||
// cbLogLevelMin
|
||||
//
|
||||
this.cbLogLevelMin.FormattingEnabled = true;
|
||||
this.cbLogLevelMin.Items.AddRange(new object[] {
|
||||
"Warn",
|
||||
"Info",
|
||||
"Debug",
|
||||
"Trace"});
|
||||
this.cbLogLevelMin.Location = new System.Drawing.Point(11, 18);
|
||||
this.cbLogLevelMin.Name = "cbLogLevelMin";
|
||||
this.cbLogLevelMin.Size = new System.Drawing.Size(97, 21);
|
||||
this.cbLogLevelMin.TabIndex = 89;
|
||||
this.cbLogLevelMin.Text = "Info";
|
||||
this.cbLogLevelMin.SelectedIndexChanged += new System.EventHandler(this.cbLogLevelMin_SelectedIndexChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(11, 4);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(79, 13);
|
||||
this.label1.TabIndex = 90;
|
||||
this.label1.Text = "LOG level (min)";
|
||||
//
|
||||
// IOBManPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.ClientSize = new System.Drawing.Size(689, 435);
|
||||
this.ClientSize = new System.Drawing.Size(689, 491);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.IsMdiContainer = true;
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "IOBManPanel";
|
||||
this.Text = "IOB MANAGER";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.IOBManPanel_FormClosing);
|
||||
@@ -411,6 +439,8 @@
|
||||
private System.Windows.Forms.Button btnStartSel;
|
||||
private System.Windows.Forms.Timer UI_Timer;
|
||||
private System.Windows.Forms.Timer forceCheckTimer;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox cbLogLevelMin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,11 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
protected string TargetExe = "";
|
||||
|
||||
/// <summary>
|
||||
/// File target x conf NLog
|
||||
/// </summary>
|
||||
protected string TargetNLogConf = "";
|
||||
|
||||
/// <summary>
|
||||
/// Name dell'exe da chiamare
|
||||
/// </summary>
|
||||
@@ -149,8 +154,14 @@ namespace IOB_MAN
|
||||
{
|
||||
InitializeComponent();
|
||||
synchronizationContext = SynchronizationContext.Current;
|
||||
|
||||
preInit();
|
||||
loadConfig();
|
||||
|
||||
// fix log...
|
||||
cbLogLevelMin.SelectedValue = "Info";
|
||||
setLogLevel("Info");
|
||||
|
||||
initTimers();
|
||||
initControls();
|
||||
updateStatus();
|
||||
@@ -893,6 +904,7 @@ namespace IOB_MAN
|
||||
uiPeriod = utils.CRI("uiPeriod");
|
||||
forceCheckPeriodMult = utils.CRI("forceCheckPeriodMult");
|
||||
TargetExe = utils.CRS("targetExe");
|
||||
TargetNLogConf = utils.CRS("TargetNLogConf");
|
||||
TargetName = utils.CRS("appNameExt");
|
||||
if (string.IsNullOrEmpty(TargetExe))
|
||||
{
|
||||
@@ -1226,5 +1238,26 @@ namespace IOB_MAN
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
|
||||
setLogLevel($"{cbLogLevelMin.SelectedItem}");
|
||||
}
|
||||
|
||||
private void setLogLevel(string selectedValue)
|
||||
{
|
||||
// leggo il file loglevel in resources
|
||||
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
|
||||
|
||||
// sostituzione livello mINIMO da selezione
|
||||
rawData = rawData.Replace("{{minLevel}}", selectedValue);
|
||||
|
||||
// scrivo conf x programma IOB-MAN
|
||||
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
|
||||
|
||||
// scrivo conf x IOB-WIN gestiti
|
||||
File.WriteAllText(TargetNLogConf, rawData);
|
||||
}
|
||||
}
|
||||
}
|
||||
+30
-32
@@ -6,36 +6,34 @@
|
||||
throwExceptions="false"
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
||||
|
||||
<!-- optional, add some variables
|
||||
https://github.com/nlog/NLog/wiki/Configuration-file#variables
|
||||
-->
|
||||
<variable name="myvar" value="myvalue"/>
|
||||
|
||||
<!--
|
||||
See https://github.com/nlog/nlog/wiki/Configuration-file
|
||||
for information on customizing logging rules and outputs.
|
||||
-->
|
||||
<targets>
|
||||
|
||||
<!--
|
||||
add your targets here
|
||||
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
|
||||
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Write events to a file with the date in the filename.
|
||||
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
|
||||
layout="${longdate} ${uppercase:${level}} ${message}" />
|
||||
-->
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<!-- add your logging rules here -->
|
||||
|
||||
<!--
|
||||
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
|
||||
<logger name="*" minlevel="Debug" writeTo="f" />
|
||||
-->
|
||||
</rules>
|
||||
<variable name="logDir" value="${basedir}/logs"/>
|
||||
<targets>
|
||||
<target xsi:type="File"
|
||||
name="f_base"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
<target xsi:type="File"
|
||||
name="f_error"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
</targets>
|
||||
<rules>
|
||||
<!-- Logging Levels (Trace, Debug, Info, Warn, Error, Fatal)-->
|
||||
<logger name="*" minlevel="Trace" maxlevel="Warn" final="true" writeTo="f_base" />
|
||||
<logger name="*" minlevel="Error" writeTo="f_error" />
|
||||
</rules>
|
||||
</nlog>
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
||||
autoReload="true"
|
||||
throwExceptions="false"
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
||||
|
||||
<!-- optional, add some variables
|
||||
https://github.com/nlog/NLog/wiki/Configuration-file#variables
|
||||
-->
|
||||
<variable name="logDir" value="${basedir}/logs"/>
|
||||
|
||||
<!--
|
||||
See https://github.com/nlog/nlog/wiki/Configuration-file
|
||||
for information on customizing logging rules and outputs.
|
||||
-->
|
||||
<targets>
|
||||
<!--
|
||||
add your targets here
|
||||
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
|
||||
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
|
||||
-->
|
||||
<target xsi:type="File"
|
||||
name="f_base"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
<target xsi:type="File"
|
||||
name="f_error"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
<!--Target per asp.net 4.5+ (NON VA con 4.0 common-->
|
||||
<!--<target xsi:type="File"
|
||||
name="f"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}|${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveEvery="Day"
|
||||
archiveOldFileOnStartup="true"
|
||||
maxArchiveFiles="90"
|
||||
enableArchiveFileCompression="true"
|
||||
keepFileOpen="true"
|
||||
/>-->
|
||||
<!--<target name="fAsync" xsi:type="AsyncWrapper" queueLimit="5" overflowAction="Discard">
|
||||
<target xsi:type="File"
|
||||
keepFileOpen="true"
|
||||
fileName="${basedir}/logs/${shortdate}_${var:codIOB:default=0000}.log"
|
||||
layout="${longdate}|${uppercase:${level}}|${var:codIOB:default=0000}|${callsite}|${message}|${exception:format=tostring}"
|
||||
archiveFileName="${basedir}/logs/${shortdate}_${var:codIOB:default=0000}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveEvery="Day"
|
||||
archiveOldFileOnStartup="true"
|
||||
maxArchiveFiles="0"
|
||||
enableArchiveFileCompression="true"
|
||||
/>
|
||||
</target>-->
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<!-- add your logging rules here -->
|
||||
<!--
|
||||
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
|
||||
<logger name="*" minlevel="Debug" writeTo="f" />
|
||||
-->
|
||||
<!--<logger name="*" minlevel="Info" maxlevel="Warn" final="true" writeTo="f_base" />-->
|
||||
<logger name="*" minlevel="Debug" maxlevel="Warn" final="true" writeTo="f_base" />
|
||||
<logger name="*" minlevel="Error" writeTo="f_error" />
|
||||
</rules>
|
||||
</nlog>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
||||
autoReload="true"
|
||||
throwExceptions="false"
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
||||
|
||||
<variable name="logDir" value="${basedir}/logs"/>
|
||||
<targets>
|
||||
<target xsi:type="File"
|
||||
name="f_base"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
<target xsi:type="File"
|
||||
name="f_error"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="false"
|
||||
/>
|
||||
</targets>
|
||||
<rules>
|
||||
<!-- Logging Levels (Trace, Debug, Info, Warn, Error, Fatal)-->
|
||||
<logger name="*" minlevel="{{minLevel}}" maxlevel="Warn" final="true" writeTo="f_base" />
|
||||
<logger name="*" minlevel="Error" writeTo="f_error" />
|
||||
</rules>
|
||||
</nlog>
|
||||
@@ -759,7 +759,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
else
|
||||
{
|
||||
lgInfo("WatchDog disabilitato");
|
||||
lgDebug("WatchDog disabilitato");
|
||||
}
|
||||
|
||||
// log opzionale!
|
||||
@@ -1095,7 +1095,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
else
|
||||
{
|
||||
lgError("IMPOSSIBILE effettuare disconnessione OpcUa: UA_ref non disponibile...");
|
||||
lgDebug("IMPOSSIBILE effettuare disconnessione OpcUa: UA_ref non disponibile...");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
else
|
||||
{
|
||||
lgInfo("WatchDog disabilitato");
|
||||
lgDebug("WatchDog disabilitato");
|
||||
}
|
||||
|
||||
// controllo se sono poweroff e se non ho dati buoni da > 2 minuti --> disconnetto
|
||||
|
||||
Reference in New Issue
Block a user