NLog.config - Update Log Layout

This commit is contained in:
DucDangAnh 2020-07-14 14:40:50 +07:00
parent 2a8a1ff1a5
commit 08c6ed210e

View File

@ -6,24 +6,16 @@
throwExceptions="false" throwExceptions="false"
internalLogLevel="Off" internalLogFile="D:\nlog-internal.log"> internalLogLevel="Off" internalLogFile="D:\nlog-internal.log">
<variable name="logDirectory" value="${basedir}/logs"/> <variable name="logDirectory" value="${basedir}/logs"/>
<variable name="logLayout" value="${date:format=HH\:mm\:ss dd-MM-yyyy} ${uppercase:${level}} ${message} ${exception}"/>
<targets> <targets>
<target xsi:type="File" name="applicationLogger" fileName="${logDirectory}/${shortdate}_App.log" <target xsi:type="File" name="applicationLogger" fileName="${logDirectory}/${shortdate}_App.log"
layout="${uppercase:${level}} ${message} ${exception}" layout="${logLayout}" maxArchiveFiles="30" encoding="Unicode" writeBom="true"/>
maxArchiveFiles="30"
encoding="Unicode"
writeBom="true"/>
<target xsi:type="File" name="pingServerLoggingFile" fileName="${logDirectory}/${shortdate}_PingServer.log" <target xsi:type="File" name="pingServerLoggingFile" fileName="${logDirectory}/${shortdate}_PingServer.log"
layout="${uppercase:${level}} ${message} ${exception}" layout="${logLayout}" maxArchiveFiles="30" encoding="Unicode" writeBom="true"/>
maxArchiveFiles="30"
encoding="Unicode"
writeBom="true"/>
<target xsi:type="File" name="pingDoorDeviceControlAccessLoggingFile" fileName="${logDirectory}/${shortdate}_PingDoorDeviceControlAccess.log" <target xsi:type="File" name="pingDoorDeviceControlAccessLoggingFile" fileName="${logDirectory}/${shortdate}_PingDoorDeviceControlAccess.log"
layout="${uppercase:${level}} ${message} ${exception}" layout="${logLayout}" maxArchiveFiles="30" encoding="Unicode" writeBom="true"/>
maxArchiveFiles="30"
encoding="Unicode"
writeBom="true"/>
</targets> </targets>
<rules> <rules>
<logger name="ApplicationLogger" minlevel="Trace" writeTo="applicationLogger" /> <logger name="ApplicationLogger" minlevel="Trace" writeTo="applicationLogger" />