2014-09-19 76 views
0

我在我的MVC項目中實現了NLog,它記錄到Db。 有建議使用NLog隊列。 發現了一些信息hereNlog使用MSMQ

樣本配置顯示NLOG將如何處理的對象的數量:

<?xml version="1.0" ?> 
nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <targets> 
     <!-- Log in a separate thread, possibly queueing up to 
     5000 messages. When the queue overflows, discard any 
     extra messages--> 

     <target name="file" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard"> 
      <target xsi:type="File" fileName="${basedir}/logs/${level}.txt" /> 
     </target> 
    </targets> 

    <rules> 
     <logger name="*" minlevel="Debug" writeTo="file" /> 
    </rules> 
</nlog> 

所以我的問題是不NLOG使用MSMQ默認?

回答

0

NLog不使用MSMQ。隊列在內存中,限制定義了隊列的最大大小,以避免佔用整個內存。

溢出操作定義了隊列滿時應該做什麼。