quartz关闭DBUG日志

引用了Quartz组件后,打印日志时,整天都有相应的调试信息打印出来,严重影响了查找日志效率,谷歌一番后,修改nlog配置文件即可

<?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"
      autoReload="true"
      internalLogLevel="Info"
      internalLogFile="internal-nlog.txt">

  <!-- 日志输出目标 -->
  <targets>
    <!-- 打印自身日志(含asp.net core请求组件格式化) -->
    <target xsi:type="File" name="comLog" fileName="Log/log-${shortdate}.log"
            layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
  </targets>

  <!-- 日志规则 -->
  <rules>
    <!-- Quartz -->
    <logger name="Quartz*" minlevel="Trace" maxlevel="Info" final="true" />
    <!-- BlackHole without writeTo -->
    <logger name="*" minlevel="Trace" writeTo="comLog" />
  </rules>
</nlog>
posted @ 2019-09-05 12:16  爱幻想の宅  阅读(1091)  评论(0编辑  收藏  举报