title: WCF Trace and Message Logging don't write log files on service host (server) side
body: <p>I've got some kind of error with my WCF services.  </p>
  
  <p>I need to determine what's going on, so I've attempted to enable service trace logging.  </p>
  
  <p>I followed the prescribed guidelines and used the <a href="http://msdn.microsoft.com/en-us/library/ms732009.aspx" rel="nofollow">wcf configuration editor</a> to setup tracing and message logging in both my client and server.  </p>
  
  <p>Tracing works fine on the client side, but the messages are of limited use in this case since they simply indicate that the real failure has been on the server and I should check the server logs:</p>
  
  <blockquote>
    <p>An error occurred while receiving the HTTP response to
        <a href="http://localhost:24162/MembershipService.svc" rel="nofollow">http://localhost:24162/MembershipService.svc</a>. This could be due to the service endpoint
        binding not using the HTTP protocol. This could also be due to an HTTP request context 
        being aborted by the server (possibly due to the service shutting down). 
        See server logs for more details.</p>
  </blockquote>
  
  <p>I'm running in debug mode, so the server in this case is the asp.net development server running on port 24162.</p>
  
  <p>My diagnostics section of the service host's web.config:</p>
  
  <pre><code> &lt;system.diagnostics&gt;
  &lt;sources&gt;
    &lt;source propagateActivity="true" name="System.ServiceModel" switchValue="Verbose,ActivityTracing"&gt;
      &lt;listeners&gt;
        &lt;add type="System.Diagnostics.DefaultTraceListener" name="Default"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
        &lt;add name="ServiceModelTraceListener"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
    &lt;source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing"&gt;
      &lt;listeners&gt;
        &lt;add type="System.Diagnostics.DefaultTraceListener" name="Default"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
        &lt;add name="ServiceModelMessageLoggingListener"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
  &lt;/sources&gt;
  &lt;sharedListeners&gt;
    &lt;add initializeData="C:\Logs\web_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      name="ServiceModelTraceListener" traceOutputOptions="Timestamp"&gt;
      &lt;filter type="" /&gt;
    &lt;/add&gt;
    &lt;add initializeData="C:\Logs\web_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp"&gt;
      &lt;filter type="" /&gt;
    &lt;/add&gt;
  &lt;/sharedListeners&gt;
  &lt;trace autoflush="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and the system.servicemodel portion</p>
  
  <pre><code>&lt;system.serviceModel&gt;
          &lt;diagnostics&gt;
        &lt;messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
          logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /&gt;
        &lt;endToEndTracing propagateActivity="true" activityTracing="true"
          messageFlowTracing="true" /&gt;
      &lt;/diagnostics&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The directory "C:\Logs" does exist and I've given 'Everyone' full control.  I've also verified that the TRACE constant is defined just to be sure.</p>
  
  <p>As you can see, I'm trying to capture anything and everything that the trace/message logging has to offer.  Anything at all.  But alas, I'm getting nothing, nada, zilch.</p>
  
  <p>After reviewing the extant questions on this site and doing a fair amount of googling, following some suggestions (making sure the folder exists, verifying that the user has appropriate permissions on the folder), I feel no closer to understanding why my tracing writes no files.  Any suggestions on how to troubleshoot trace logging?  Is there any information logged somewhere else that would indicate why tracing is not working?  </p>
  
  <p>for reference and future readers - </p>
  
  <p>I went <a href="http://rocksolidknowledge.com/ScreenCasts.mvc/Watch?video=WCFTracing.wmv" rel="nofollow">here</a> for service trace logging configuration instructions.
  I went <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/7a372b9e-8e2a-4704-a96e-95cf66a7e6c2" rel="nofollow">here</a> and <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/690b86c2-6462-44a1-bb1e-a0ddf6a4dc83/" rel="nofollow">here</a> to try and troubleshoot the log files not being written.</p>