【发布时间】:2021-08-27 13:54:29
【问题描述】:
我想将所有记录器设置为记录到一个文件中,但特定类的记录器除外。我似乎无法弄清楚该怎么做。目前我正在尝试以下 nlog.config
无论我做什么,拦截器都在记录
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="file" xsi:type="File"
fileName="${basedir}/logs/log.log"
maxArchiveFiles="1" archiveAboveSize="1000000" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
<logger name="MyApp.DbInterceptionConfig+LoggingEFInterceptor" minlevel="Info" writeTo="file" />
</rules>
</nlog>
【问题讨论】:
-
George,第 10 行似乎是多余的或缺少行的请求。
标签: nlog