Files
2025-11-20 16:20:37 +08:00

36 lines
1.9 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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">
<!-- enable asp.net core layout renderers -->
<targets>
<!--项目日志保存文件路径说明fileName="${basedir}/保存目录,以年月日的格式创建/${shortdate}/${记录器名称}-${单级记录}-${shortdate}.txt"-->
<target name="info_file" xsi:type="File"
fileName="${basedir}/Logs/${shortdate}/info_${shortdate}.txt"
layout="${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=ToString} ${newline} ${stacktrace} ${newline}"
archiveFileName="${basedir}/archives/info_${shortdate}-{#####}.txt"
archiveAboveSize="102400"
archiveNumbering="Sequence"
concurrentWrites="true"
keepFileOpen="false" />
<target name="error_file" xsi:type="File"
fileName="${basedir}/Logs/${shortdate}/error_${shortdate}.txt"
layout="${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=ToString} ${newline} ${stacktrace} ${newline}"
archiveFileName="${basedir}/archives/error_${shortdate}-{#####}.txt"
archiveAboveSize="102400"
archiveNumbering="Sequence"
concurrentWrites="true"
keepFileOpen="false" />
</targets>
<!--规则配置,final - 最终规则匹配后不处理任何规则-->
<!--规则配置,final - 最终规则匹配后不处理任何规则-->
<!--定义使用哪个target输出-->
<rules>
<!-- 优先级从高到低依次为OFF、FATAL、ERROR、WARN、INFO、DEBUG、TRACE、 ALL -->
<!-- 将所有日志输出到文件 -->
<logger name="*" minlevel="FATAL" maxlevel="FATAL" writeTo="info_file" />
<logger name="*" minlevel="Error" writeTo="error_file" />
</rules>
</nlog>