Dec 31, 2012
2 mins read
輸出到檔案是預設的設定,可以是一個或是多個檔案
非同步,每小時寫檔,UTF8格式
<?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”><!--
See http://nlog-project.org/wiki/Configuration_file for information on customizing logging rules and outputs. –> <targets> <target xsi:type="AsyncWrapper” name="f” queueLimit="5000” overflowAction="Discard”> <target xsi:type="File” fileName="${basedir}/logs/${date:format=yyyy-MM-dd-HH}.log” layout="${longdate} ${uppercase:${level}} ${message}” encoding="utf-8” /> </target> </targets> <rules> <logger name=”*” minlevel="Trace” writeTo="f” /> </rules> </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"><!--
See http://nlog-project.org/wiki/Configuration_file for information on customizing logging rules and outputs. –> <targets> <target xsi:type="AsyncWrapper” name="f” queueLimit="5000” overflowAction="Discard”> <target xsi:type="File” fileName="${basedir}/logs/${date:format=yyyy-MM-dd-HH}.log” layout="${longdate} ${uppercase:${level}} ${message}” encoding="utf-8” /> </target> </targets> <rules> <logger name=”*” minlevel="Trace” writeTo="f” /> </rules> </nlog>
Sharing is caring!