<?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"
autoReload="true"
throwExceptions="true" internalLogLevel="Fatal"
internalLogFile="c:\temp\nlog-internal.log">
<!--此部分中的所有目标将自动异步-->
<targets>
<target name="asyncFile" xsi:type="AsyncWrapper">
<target xsi:type="RetryingWrapper">
<target xsi:type="file" name="File"
fileName="${basedir}/RXSMPData/Log/${date:format=yyyy-MM-dd}/${level}.log"
layout="${longdate}||${level}||${callsite:className=true:includeSourcePath=false:methodName=true}||${message}||${exception:format=ToString:innerFormat=ToString:maxInnerExceptionLevel=10:separator=\r\n}||end"
archiveAboveSize="102400"
concurrentWrites="true"
keepFileOpen="false"/>
</target>
</target>
<!--使用可自定义的着色将日志消息写入控制台-->
<target name="colorConsole" xsi:type="ColoredConsole" layout="[${date:format=yyyy-MM-dd HH\:mm\:ss}]:${message} ${exception:format=message}" >
<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>
</targets>
<rules>
<logger name="Microsoft.*" minlevel="Info" writeTo="" final="true" />
<logger name="*" minlevel="Info" writeTo="asyncFile" />
<logger name="*" minlevel="Debug" writeTo="colorConsole" />
</rules>
</nlog>
03-01
2869