0

I have a WCF service,which is having a high request response cycle during peak hours. This can be around 5000 to 8000 requests a minute. There were some issues with connections and 500 response code. So i enabled trace listener to trace the errors happening on server side. Eventually i manage to find the error and this is fixed. Now WCF is working fine. But the issue is size of Web_tracelog file is increasing exponentially. When i try to open the file in traceviewer, it shows no errors or issues.

I deleted the file.

Within 30 minutes the size again was 200 MB. But when opened there was nothing in the file and it says no trace loaded from the file.

It is a bit hard to understand this. I want to keep the tracelistener enabled, so if there are any errors in case, then i can trace them.

Sunil Sharma
  • 782
  • 1
  • 10
  • 22

1 Answers1

0

Consider changing the Switch settings for the trace configuration which is usually Verbose to Error, eg:

<add name="System.Net" value="Error"/>

This post documents the possible values as Critical, Error, Verbose, Warning, and Information. It doesn't describe them in detail but I am reasoning that Error is going to write less than Verbose.

I believe the empty file issue is caching behavior with the TextWriterTraceListener. Even with autoflush=true, you need to stop the application, in this case your WCF service, to flush the cache and get everything in the file. This post describes it as buffering in 8kb chunks but I have found it to cache much more as well. Perhaps someone else could explain that.

GMan80013
  • 536
  • 4
  • 13