<?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>
    <!-- 文件目标 -->
    <target xsi:type="File" 
            name="fileTarget"
            fileName="logs/${shortdate}.log"
            layout="${longdate} ${uppercase:${level}} ${message} ${exception:format=ToString}" />
    
    <!-- 控制台目标 -->
    <target xsi:type="Console"
            name="consoleTarget"
            layout="${longdate} ${uppercase:${level}} ${message} ${exception:format=ToString}" />
  </targets>

  <rules>
    <!-- 记录所有级别高于 Debug 的日志到文件 -->
    <logger name="*" minlevel="Debug" writeTo="fileTarget" />
    
    <!-- 记录所有级别高于 Info 的日志到控制台 -->
    <logger name="*" minlevel="Info" writeTo="consoleTarget" />
  </rules>
</nlog>