Where are the Server Logs?

Friday, February 18, 2011
by asalvo

Today I started a new WCF Data Services project, set my data context (well actually I didn’t as we’ll see in a moment), hit F5 and I was greeted with a very unhelpful error message: The server encountered an error processing the request. See server logs for more details (see image below).

image

I had no idea where these server logs are, and in fact I still don’t. Searching around led to several people with the same problem, but different causes:

  • Incorrect correction string, usually from a minor typo
  • Typo in one of the strings in the IntializeServiceMethod

Thankfully you can get some type of an error message displayed if you add the following class level attribute to your Data Service class:

[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
I then came across this [stack overflow question](http://stackoverflow.com/questions/54380/problem-rolling-out-ado-net-data-service-application-to-iis) which explains how to enable the server logs talked about in the original error message. They are in fact svclog files, which can be viewed using SvcTraceViewer. If I am remembering correctly, these would be the same log files that are created with WCF services, which makes sense.

Comments

comments powered by Disqus