You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
1.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true" throwExceptions="true">
<!-- the targets to write to -->
<targets>
<!--单个文件过大会导致写入效率下降,可配置单个文件的最大容量-->
<target name="File" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
<target xsi:type="File"
createDirs="true"
fileName="${basedir}/logs/${level}/${shortdate}.log"
layout="${date:yyyy-MM-dd HH\:mm\:ss} ${level:uppercase=true} ${message} ${event-context:item=Amount} ${stacktrace} ${exception}"
maxArchiveFiles="5"
archiveEvery="Day"
maxArchiveDays="7"
/>
</target>
</targets>
<!-- rules to map from logger name to target -->
<rules>
<!--<logger name="*" levels="Debug,Info,Warn,Error" writeTo="File" />-->
<logger name="*" minlevel="Debug" maxlevel="Error" writeTo="File" />
</rules>
</nlog>