title: WCF logging producing multiple svc file
body: <p>I have a simple WCF service library called HelloService which is hosted in WCF Service application. </p>
  
  <p>My service is hosted in remote IIS server. Below is my service configuration for logging.</p>
  
  <pre><code>&lt;system.diagnostics&gt;
  &lt;sources&gt;
    &lt;source propagateActivity="true" name="System.ServiceModel" switchValue="Error,ActivityTracing"&gt;
      &lt;listeners&gt;
        &lt;add name="xml"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
    &lt;source name="System.ServiceModel.MessageLogging" switchValue="Error"&gt;
      &lt;listeners&gt;
        &lt;add name="xml"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
    &lt;source name="myUserTraceSource" switchValue="Error,ActivityTracing"&gt;
      &lt;listeners&gt;
        &lt;add name="xml"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
  &lt;/sources&gt;
  &lt;sharedListeners&gt;
    &lt;add initializeData="D:\HelloService\HelloServiceLogs.svclog"
      type="System.Diagnostics.XmlWriterTraceListener" name="xml"
      traceOutputOptions="Timestamp"&gt;
      &lt;filter type="" /&gt;
    &lt;/add&gt;
  &lt;/sharedListeners&gt;&lt;/system.diagnostics&gt;
  </code></pre>
  
  <p>When I call this service, sometimes it logs in existing file and sometimes it creates new file.
  <a href="https://i.stack.imgur.com/BdJGB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BdJGB.png" alt="logFileCreated"></a></p>
  
  <p>My questions are.</p>
  
  <p>1) Why does it produces so many log files? How to write all logs in one file called.</p>
  
  <p>2) How can I only log all unhandled exception?</p>