Web API 2 Equivalent for WCF.svclog Files

Background

I am trying to troubleshoot some issues with .NET Web API 2 service. The issues are inconsistent and from the requesting service all we can see are "Connection Reset" and "Socket Exceptions". It doesn't even end up in custom code / logging in the API, but for low level exceptions that don't control the WEB API as the culprit.

Research

A very useful tool in the past for troubleshooting similar issues in WCF has been enabling WCF tracing . I'm looking for an equivalent that can show a low level service trace for a web API.

I found Global Error Handling and I have used packages like Elmah in the past. but as far as I know this only shows unhandled exceptions, as opposed to the whole trail of a service like svclog.

I also know about Fiddler and Wireshark, and although they are great http and low-level protocol tracking tools. At the moment, I'm more interested in what the .NET service thinks it is receiving and how it handles those actions, rather than the packages that do it over the wire.

Summary

Is there a Web API 2 equivalent for WCF.svclog? Special attention is paid to the interaction of low-level services with bytes / requests.

Edit

I accepted the best answer, both answers pointed to the same tracking form. It's worth noting that the trace did not show any further information for this particular issue, however I believe this is the closest Web API trace for WCF svclog.

+3


source to share


2 answers


There is no direct equivalent solution in WebAPI, but V2 adds some tracing capabilities. You can refer to the following article.

Tracing in ASP.NET Web API 2



If you are having connectivity issues, I would also check the IIS logs and the httperr logs, which can give you more details on such issues.

+2


source


WCF and WebAPI night and day. WCF has a complex messaging infrastructure with a lot of middleware that requires the level of tracking they provide for troubleshooting.

WebAPI, on the other hand, is pretty simple and there is very little between the request itself and your code. Any problem in this code is YSOD (i.e. a 500 error, which, if custom errors are disabled, will show an exception). Just like MVC or even a standard ASP.NET application.

Now there is some kind of traceback, but it's not svclog as with WCF. There is information here:



http://blogs.msdn.com/b/roncain/archive/2012/04/12/tracing-in-asp-net-web-api.aspx

You will need to write your own registrar, although there are probably several registrars you can find already.

+2


source







All Articles