tags:

views:

139

answers:

2

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, until 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??

+2  A: 

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

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.

Daniel Vassallo
A: 

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

DaveB