24 lines
1.1 KiB
Plaintext
24 lines
1.1 KiB
Plaintext
|
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
|
||
|
|
||
|
<!--[變數] 文字樣板 -->
|
||
|
<variable name="Layout" value="${longdate} | ${level:uppercase=true} | ${logger} | ${message} ${newline}"/>
|
||
|
<variable name="LayoutFatal" value="${longdate} | ${level:uppercase=true} | ${logger} | ${message} | ${exception:format=tostring} ${newline}"/>
|
||
|
|
||
|
<!--[變數] 檔案位置 -->
|
||
|
<variable name="LogTxtLocation" value="${basedir}/App_Data/Logs/${shortdate}/${logger}.txt"/>
|
||
|
<variable name="LogTxtLocationFatal" value="${basedir}/App_Data/Logs/${shortdate}/FatalFile.txt"/>
|
||
|
|
||
|
<!--[設定] 寫入目標-->
|
||
|
<targets>
|
||
|
<target name="File" xsi:type="File" fileName="${LogTxtLocation}" layout="${Layout}" />
|
||
|
<target name="FileFatal" xsi:type="File" fileName="${LogTxtLocationFatal}" layout="${LayoutFatal}"/>
|
||
|
</targets>
|
||
|
|
||
|
<!--[設定] 紀錄規則-->
|
||
|
<rules>
|
||
|
<logger name="*" levels="Trace,Debug,Info,Warn" writeTo="File" />
|
||
|
<logger name="*" levels="Trace,Debug,Info,Warn,Error,Fatal" writeTo="FileFatal" />
|
||
|
</rules>
|
||
|
|
||
|
</nlog>
|