How to restrict WCF registration

We use many WCF applications in our application, and we find that logging is really useful, but files tend to grow quite quickly. In fact, we can usually only play with the service for 10 minutes or so, as long as the log file is larger than 10 MB and is too slow to load.

In any case, to limit the registration to only 1000 entries or to use a sliding file, etc.?

+4
source share
2 answers

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

Ever had the problem of increasing svclog files after setting up tracing in a productive WCF environment? Don't want to restart the application just to delete or move trace files?

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

+4
source

"Configuring message logging" describes how to limit log files to a specific size or number of entries. I found this to be a really useful document.

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

+1
source

Source: https://habr.com/ru/post/1302713/


All Articles