eventloglistener在发布模式下不会写入事件日志

时间:2016-02-25 14:07:07

标签: c# listener

我在我的项目中使用了EventLogListener。它在调试模式下工作正常,并写入事件日志。但是当使用释放模式时它会突然停止..

我该如何以正确的方式使用它?

<trace autoflush="true" indentsize="2">
  <listeners>
    <!--<remove name="Default" />-->
    <add name="EventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="myproj" />
  </listeners>
</trace>
<switches>
  <!--
        "0" Off            
        "1" Error messages            
        "2" Warning, gives Error and Warning messages            
        "3" Information, gives Error, Warning and Information messages            
        "4" Verbose, gives Error, Warning, Information and Verbose messages
        -->
  <add name="myproj" value="4" />
</switches>

0 个答案:

没有答案
相关问题