开发者

Is there a way to do on demand flushing of WCF trace?

Just like there is a command to flush IIS7 logs:

ne开发者_如何学Gotsh http flush logbuffer

I'm wondering is there a similar command to flush WCF trace log on demand.


Setting the autoflush="true" in your .config file ensures that the trace sources flush to disk after each trace.

The following is a sample configuration file with autoflush="true":

<configuration>
 <system.diagnostics>
  <sources>
   <source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
                 propagateActivity="true">
     <listeners>
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener"
                      initializeData="e2eTraceTest.xml" />
    </listeners>
   </source>
  </sources>

  <trace autoflush="true" />

 </system.diagnostics>
</configuration>

In addition, if by any chance you are willing to store your WCF trace in a database, you might want to check out this post:

  • Stack Overflow: How can I enable WCF logging so that it writes to a Database?'

This would allow you to view your WCF trace in real-time, without flushing it.


One way is to do an IIS reset, but this is only really an option when debugging on a developmnet box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜