<?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>
    <!--这个目标:最终输出文件类型, 位于根目录中得logs文件夹中, 名称以每日得时间一次生成log文件 , layout: 这个选项为生成的格式-->
    <target xsi:type="File" name="f" 
            fileName="${basedir}/logs/${shortdate}.log"
            layout="${longdate}, ${uppercase:${level}}, ${message}" />
    <target xsi:type="File" name="csvFileExample" fileName="${basedir}/logs/${shortdate}.csv">
        <layout xsi:type="CsvLayout" delimiter="Tab" withHeader="false">
        <column name="time" layout="${longdate}," quoting="Nothing" />
        <column name="level" layout="${level:upperCase=true}," quoting="Nothing"/>
        <column name="message" layout="${message}," quoting="All" />
        <column name="exception" layout="${exception:format=ToString}," quoting="All"/>
        <column name="property1" layout="${event-properties:property1},"/>
        <column name="stacktrace" layout="${stacktrace:topFrames=10}," />
        </layout>
    </target>
  </targets>

  <rules>
    <!--设定了一个Debug得路由, 最终指向了一个f名称得目标 -->
    <logger name="*" minlevel="Debug" writeTo="f" />
  </rules>
</nlog>
