<?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">
  <!--<targets async="true">
    --><!-- fileName="${basedir}/App_Data/Logs/${shortdate}/${logger}.txt" --><!--
    <target name="file" xsi:type="File" fileName="${basedir}/Logs/${shortdate}.txt" />
  </targets>-->
  
  <!--[設定] 寫入目標-->
  <targets async="true">
    
    <target name="MasterTradeCS_Watch"
        type="File"
        deleteOldFileOnStartup ="false"
        layout="[${longdate}][${level}] ${message} | ${stacktrace}"
            
        fileName="${basedir}/Log/MasterTradeCS_${date:format=yyyyMMdd}.txt"
        concurrentWrites="true"
        keepFileOpen="false"
        encoding="Big5"
            />
    
    <!--XTrade-->
    <target name="XTrade_Watch"
        type="File"
        deleteOldFileOnStartup ="false"
        layout="${longdate}|${level}|${threadid}|${message}|${stacktrace}"
            
        fileName="${basedir}/Log/XTrade_${date:format=yyyyMMdd}.txt"
        concurrentWrites="true"
        keepFileOpen="false"
        encoding="Big5"
            />
    <target name="OrderMapping"
    type="File"
    deleteOldFileOnStartup ="false"
    layout="${message}"
            
    fileName="${basedir}/OrderMapping/${date:format=yyyyMMdd}.txt"
    concurrentWrites="true"
    keepFileOpen="false"
    encoding="Big5"
            />
    <target name="XTrade_RTRptLog_Watch"
            type="File"
            deleteOldFileOnStartup ="false"
            layout="${longdate}|${level}|${threadid}|${message}|${stacktrace}"
            
            fileName="${basedir}/Log/XTrade_RTRptLog_${date:format=yyyyMMdd}.log"
            concurrentWrites="true"
            keepFileOpen="false"
            encoding="Big5"
            />

  </targets>

  <!--[設定] 紀錄規則-->
  <rules>
    <!--<logger name="*" minlevel="Debug" writeTo="file" />-->
    <logger name="MasterTradeCS_LOG" minlevel="Trace" writeTo="MasterTradeCS_Watch" final ="true" />
    <!--XTrade-->
    <logger name="XTrade_LOG" minlevel="Trace" writeTo="XTrade_Watch" final ="true" />
    <logger name="XTrade_RTRptLog" minlevel="Trace" writeTo="XTrade_RTRptLog_Watch" final ="true" />
    <logger name="ORD" minlevel="Trace" writeTo="OrderMapping" final ="true" />
  </rules>

</nlog>

<!--fileName="${basedir}/Log/${date:format=yyMMdd}/${date:format=HH}.txt"-->

<!--archiveFileName="${basedir}/Log/${date:format=yyMMdd}/${date:format=HH}.{#####}.txt"
archiveAboveSize="10485760"
archiveNumbering="Sequence"
MaxArchiveFiles="20"-->