tags:

views:

29

answers:

2

Hi,

I have deployed a few WCF services to a server via a web setup project they are being hosted in an IIS Application, which appears to be running fine.

However when i try to navigate to the wsdl, nothing is found.

I am trying to set up diagnostics logging, to get some information.

I have followed the advice from here: http://stackoverflow.com/questions/2850653/wcf-trying-to-set-up-tracing-to-debug-not-writing-to-log-file

Also, I have tried what is in the referenced MSDN documentation here: http://msdn.microsoft.com/en-us/library/aa702726.aspx under "Recommended Settings for Deployment or Debugging" .. my web.config has that identical configuration. But no log file is being created.

Nothing useful in the event viewer.

Any ideas? Thanks!!

A: 

Could be a permissions issue; IIRC those don't always turn up in the event log. Ensure the user IIS runs under has write permissions to the log file path.

Randolpho
thanks for the idea. I've temporarily given 'Everyone' full control over c:\logs, but nothing has been written yet.
j g
Hmm... do the IIS logs indicate the request is being handled? What is the HTTP response code?
Randolpho
interestingly enough, nothing is showing up in the IIS logs when i try to access it.
j g
A: 

This is typically the diagnostic config I use. Seems to work for me.

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
  ... 
  <system.diagnostics> 
    <trace autoflush="true" /> 
    <sources> 
      <source name="System.ServiceModel" 
              switchValue="Verbose"> 
        <listeners> 
          <add name="sdt" 
              type="System.Diagnostics.XmlWriterTraceListener" 
              initializeData="D:\wcfLog.svcLog"  /> 
        </listeners> 
      </source> 
    </sources> 
  </system.diagnostics> 
</configuration>

If you are not getting any output it may be because your service is not starting correctly. The ServiceHost must be up for diagnostics to output anything. With IIS even though your site is running it does not mean that the ServiceHost started correctly. It's usually a config issue. I'm not a web guy but doesn't IIS write to EventViewer if there is an unhandled exception in the website?

Also, you could try creating a custom ServiceHostFactory. That way your code controls the ServiceHost creation and you can trap any exceptions and log them on your own.

Creating a custom ServiceHost in IIS -> LINK

Mogounus