Search code examples
wcfloggingperfmon

Using Performance Counters to monitor WCF Service


I have a requirement to monitor the average time it takes a WCF web service to process a service request. Researching on-line I see that one way is to use performance counters. I activated the counters using the web services' web.config file using:

<system.serviceModel>
  <diagnostics performanceCounters="All" />
</system.serviceModel>

I can now view the relevant data in real time using perfmon (6.1.7600). How can I create and output these values to a rolling log file that appends the information to the bottom? I've tried using perfmon but can't seem to find the option?


Solution

  • You can set this up using perfmon Data Collector Sets. Right click on the DataCollector itself (double click your set to access the collector) then go to the File tab. From there just set the maximum samples & select Circular Logging. You can also specify whether you want to log to a .csv, .tsv, or binary file. Here's a good Technet article on configuring a DataCollectorSet.