title: Logging with WCF and WebSphere MQ
body: <p>I have a solution where I have configured a WCF one way service with WebSphereMQ.  The is self hosted within a NT service.  This has all been working well for some years but now our customer upgraded to WebSphere 7.5 and since this we have been getting approx once a day:</p>
  
  <p><strong>Service host went into fault state</strong></p>
  
  <p>I have been trying to track down what is causing this. I catch all exceptions within my service code and log.  Nothing there!  I have turned on WCF trace, again nothing there! According to the log svclog, there isn't even a message being processed when the host goes into fault state.  So as a final resort I would like to log what is happening in the WebSphere WCF extensions (XMS)</p>
  
  <p>According to the <a href="https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q030120_.htm" rel="nofollow">IBM help page</a> this should be no problem and here is my config.</p>
  
  <pre><code> &lt;sources&gt;
     &lt;source name="IBM.XMS.WCF" 
       switchValue="Information, ActivityTracing" 
       propagateActivity="true"
       xmsTraceSpecification="*=all=enabled"
       xmsTraceFilePath="E:\Log\Services\JobServiceSTP\AddIns\"
       xmsTraceFileSize="20000000" 
       xmsTraceFileNumber="20" 
       xmsTraceFormat="basic"&gt;
       &lt;listeners&gt;
         &lt;add name="traceListener" 
              type="System.Diagnostics.XmlWriterTraceListener"
    initializeData="E:\Log\Services\JobServiceSTP\AddIns\STPMonitor.svclog" /&gt;
       &lt;/listeners&gt;
     &lt;/source&gt;
   &lt;/sources&gt;
  </code></pre>
  
  <p>However when I do this I get the following error:</p>
  
  <p><em>System.Configuration.ConfigurationErrorsException: 
  'xmsTraceFileNumber' is not a valid configuration attribute for type 'System.ServiceModel.Diagnostics.DiagnosticTraceSource</em></p>
  
  <p>Am I misunderstanding the IBM help page in any way or missing something for example in the <code>&lt;configSections&gt;</code>?
  Is there any better way to track down this sudden service host shutdown?</p>