ASP.NET MVC 4 Web Api: Diagnostic Functions

I am looking for a function that allows loggin / tracing in ASP.NET MVC 4 Web Api. In WCF, you can activate the logging and WCF entries that it makes. Then I can open the dump and find the errors.

I do not want to trace my web api, but write down what the infrastructure does. If I trace / register web api with message handlers, I get no information if an error occurs before my implementation.

+5
source share
2 answers

I would recommend two things.

1) To get detailed information about thrown exceptions, I would always set an error policy. This should return more verbose exception messages from your code.

  GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

, RC.

2) , /. . . WebAPIContrib GitHub repo,

3) , asp.net, asp.net, . .

+4

. http://www.asp.net/web-api/overview/testing-and-debugging/tracing-in-aspnet-web-api

ITraceWriter ( , System.Diagnostics.Trace), - API , .

  • Mike
+7

All Articles