NLog Debugger Target

NLog Debugger Target

將Log輸出到Vistual Studio的輸出視窗,Web應用程式的開發很有幫助

屬性

基本上和其他Target一樣,沒有特別需要介紹的屬性
完整資料還是參考官網的Debugger Target文件



name - Target的名稱 header - 頭部格式
layout - 輸出格式 footer - 尾部格式
屬性很簡單,設定檔也簡單
<?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=”Debugger” name=”f”
layout=”${longdate} ${uppercase:${level}} ${message}” />
</targets>
<rules>
<logger name=”*” minlevel=”Trace” writeTo=”f” />
</rules>
</nlog>