1

This question came up from what I see on a clients side: Intermittent Connection Reset by Peer errors in Android connecting to .NET REST endpoint

Simply put, I suspect that my WCF service for some reason intermittenly reject clients. I wonder if there is any way to log those rejections? I'm not even sure if that happens on WCF level, maybe it happens in IIS itself before routed to WCF?

I want to know how to log any errors for requests coming to my WCF endpoint. Inside WCF there is no issues, I log any kind of exceptions thrown.

Community
  • 1
  • 1
katit
  • 17,375
  • 35
  • 128
  • 256

1 Answers1

1

As you can see on this link: http://msdn.microsoft.com/en-us/library/ms733025.aspx using system.diagnostics section of config you can configure your service to trace all action executed to complete an operation. This parameter: initializeData= "c:\log\Traces.svclog" /> is the file location where trace information will be saved.

Roberto Conte Rosito
  • 2,080
  • 12
  • 22
  • Any way to do same programmatically so I can log errors in my own store? – katit Jun 14 '12 at 04:07
  • You can add your custom Behavior before and after service operation execution. WCF provide a strong Pipeline where you can implement and add your custom code to handle specific situations. This is a good article to understand this mechanism: http://msdn.microsoft.com/en-us/magazine/cc163302.aspx – Roberto Conte Rosito Jun 14 '12 at 08:59