开发者

How to restrict WCF logging

开发者 https://www.devze.com 2022-12-22 00:15 出处:网络
We\'ve using lots of WCF services in our application and we\'re finding the logging is really useful but the files tend to grow fairly quickly. In fact, we can usually only play around witha service f

We've using lots of WCF services in our application and we're finding the logging is really useful but the files tend to grow fairly quickly. In fact, we can usually only play around with a service for 10 minutes or so, unt开发者_JAVA百科il the log file is more then 10mb and too slow to load.

Is there anyway to restrict the logging to only 1000 entries, or use a rolling file, etc??


You might be interested in checking out the following trace listener:

  • The Code Project: A Rolling XmlWriterTraceListener

Ever had the problem of growing svclog files after configuring tracing in a productive WCF environment? Did not want to restart the application just for deleting or moving the trace files?

Then, you will like the RollingXmlWriterTraceListener, which is a specialized XmlWriterTraceListener, and is completely compatible with the WCF tracing facility.


Congfiguring Message Logging describes how to restrict the log files to a certain size or number of entries. I found this to be a real helpful document.

http://msdn.microsoft.com/en-us/library/ms730064.aspx

0

精彩评论

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

关注公众号