添加项目文件。
This commit is contained in:
37
Logger/Nlog.config
Normal file
37
Logger/Nlog.config
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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">
|
||||
|
||||
<!-- 定义目标 -->
|
||||
<targets>
|
||||
<!-- SQL 日志 -->
|
||||
<target name="sqlLog" xsi:type="File"
|
||||
fileName="Logs/${shortdate}_sql.txt"
|
||||
layout="${longdate} [${level}] [ThreadId:${threadid}] ${message} ${exception}"
|
||||
encoding="utf-8" />
|
||||
|
||||
<!-- Info 日志 -->
|
||||
<target name="infoLog" xsi:type="File"
|
||||
fileName="Logs/${shortdate}_info.txt"
|
||||
layout="${longdate} [${level}] [ThreadId:${threadid}] ${message} ${exception}"
|
||||
encoding="utf-8" />
|
||||
|
||||
<!-- Warn 日志 -->
|
||||
<target name="warnLog" xsi:type="File"
|
||||
fileName="Logs/${shortdate}_warn.txt"
|
||||
layout="${longdate} [${level}] [ThreadId:${threadid}] ${message} ${exception}"
|
||||
encoding="utf-8" />
|
||||
</targets>
|
||||
|
||||
<!-- 定义日志规则 -->
|
||||
<rules>
|
||||
<!-- SQL 日志规则 -->
|
||||
<logger name="SqlLogger" minlevel="Info" writeTo="sqlLog" />
|
||||
|
||||
<!-- Info 日志规则 -->
|
||||
<logger name="InfoLogger" minlevel="Info" maxlevel="Info" writeTo="infoLog" />
|
||||
|
||||
<!-- Warn 日志规则 -->
|
||||
<logger name="*" minlevel="Warn" writeTo="warnLog" />
|
||||
</rules>
|
||||
</nlog>
|
||||
Reference in New Issue
Block a user