2013-02-02 73 views
0

嘗試使用NLog獲取一些基本的ASP.NET Web API跟蹤。NLog - ASP.Net Web API跟蹤

很多搜​​索的唯一文件我能找到的經過是在這裏:http://nlog-project.org/2010/09/02/routing-system-diagnostics-trace-and-system-diagnostics-tracesource-logs-through-nlog.html

用於Web API以上的心不是,但我已經努力去適應它,這個問題似乎是在我的web.config:

<system.diagnostics> 
    <sources> 
     <source name="System.Web.Http.ApiController" switchValue="All">   
     <listeners> 
      <add name="nlog" /> 
     </listeners> 
     </source> 
    </sources> 
    <sharedListeners> 
     <add name="nlog" type="NLog.NLogTraceListener, NLog" /> 
    </sharedListeners> 
    </system.diagnostics> 

任何想法爲什麼它不工作或引用一個例子?

回答