locked
WCF Data Service : Where are the "server logs"? RRS feed

  • Question

  • Hi,
    I'm just getting to grips with my first WCF Data Service. I'm launching it in VS2008 using the ASP.Net Development Server and I am getting error:

    The server encountered an error processing the request. See server logs for more details.

    I'm afraid I don't know where these server logs might be for the ASP.Net Dev Server. Can someone out there let me know?

    thanks
    Jamie


    http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Friday, March 12, 2010 10:13 PM

Answers

  • Hi,

    I usually find some of these options easier than searching the logs:
    1) Debug your service (F5 from VS) and set it to catch all exceptions (Ctrl+Alt+E and choose Common Language Runtime exceptions). You might get some exception you're not interested in (Registry Access, some configuration stuff), but those you're gonna be interested in are either comming from your code or from WCF Data Services (can be seen in the call stack)
    2) Make the service report errors nicely. In your InitializeService add config.UseVerboseErrors=true, this will make the service return some nice error messages.

    Thanks,
    Vitek Karas [MSFT]
    • Marked as answer by Jamie Thomson Saturday, March 13, 2010 7:31 AM
    Friday, March 12, 2010 10:19 PM
    Moderator

All replies

  • Hi,

    I usually find some of these options easier than searching the logs:
    1) Debug your service (F5 from VS) and set it to catch all exceptions (Ctrl+Alt+E and choose Common Language Runtime exceptions). You might get some exception you're not interested in (Registry Access, some configuration stuff), but those you're gonna be interested in are either comming from your code or from WCF Data Services (can be seen in the call stack)
    2) Make the service report errors nicely. In your InitializeService add config.UseVerboseErrors=true, this will make the service return some nice error messages.

    Thanks,
    Vitek Karas [MSFT]
    • Marked as answer by Jamie Thomson Saturday, March 13, 2010 7:31 AM
    Friday, March 12, 2010 10:19 PM
    Moderator
  • Thanks Vitek. All I really want to know though is, where do the logs get created?

    thanks
    Jamie
    http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Saturday, March 13, 2010 7:32 AM
  • Hi,

    I actually don't know where the logs go, since I never really needed it. Try asking on ASP.NET forums http://forums.asp.net/.

    Thanks,
    Vitek Karas [MSFT]
    Monday, March 15, 2010 9:30 AM
    Moderator
  • Add the following to your web.config, you specify where the log goes in the initializeData attribute of the tracelistener

      <system.serviceModel>
        <diagnostics>
          <messageLogging logEntireMessage="true" logMalformedMessages="true"
            logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
        </diagnostics>
      </system.serviceModel>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true">
            <listeners>
              <add name="traceListener"
                  type="System.Diagnostics.XmlWriterTraceListener"
                  initializeData= "C:\Temp\SvcLog\Traces.svclog" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    

    Thursday, January 19, 2012 12:24 AM
  • Thanks this helped.
    Tuesday, June 9, 2015 4:18 PM