Files
zszq-trs/UnitTestProject/NLog.config
T
2024-05-09 14:06:26 +08:00

29 lines
1.4 KiB
XML

<?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:\nlog\internal.log">
<targets>
<!---10M的信息日志文件-->
<target xsi:type="File" name="file" fileName="${basedir}/log/${shortdate}.log"
layout="${longdate}|${logger}|${uppercase:${level}}|${message};${exception:format=Message}" encoding="utf-8" archiveAboveSize="10485760" maxArchiveFiles="30" concurrentWrites="false" />
<!---10M的错误日志文件-->
<target xsi:type="File" name="file_error" fileName="${basedir}/log/${shortdate}.error.log"
layout="${longdate}|${logger}|${uppercase:${level}}|${message};${exception:format=ToString:innerFormat=ToString:maxInnerExceptionLevel=3}" encoding="utf-8" archiveAboveSize="10485760" maxArchiveFiles="60" concurrentWrites="false" />
<!---Debug日志-->
<target name="debug" xsi:type="Console" layout="${longdate}|${logger}|${uppercase:${level}}[${threadid}]|${message};${exception:format=Message}" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file" />
<logger name="*" minlevel="Error" writeTo="file_error" />
<logger name="*" minlevel="Debug" writeTo="debug" />
</rules>
</nlog>