title: Using Trace Listener redirects ALL Debug Output
body: <p>I followed this <a href="http://www.daveoncsharp.com/2009/09/create-a-logger-using-the-trace-listener-in-csharp/" rel="nofollow">Create a Logger using the Trace Listener in C#</a>  article with the belief that only <code>Trace.WriteLine()</code> statements will be written in the <code>application.log</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;system.diagnostics&gt;
      &lt;trace autoflush="true" indentsize="4"&gt;
        &lt;listeners&gt;
          &lt;add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="application.log" /&gt;
          &lt;remove name="Default" /&gt;
        &lt;/listeners&gt;
      &lt;/trace&gt;
    &lt;/system.diagnostics&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But to my dismay, all of my <code>Debug.WriteLine()</code> that used to go to the <code>Output</code> tab disappeared from that tab and instead they all now go to the trace file <code>application.log</code>.</p>
  
  <p>Is there a way to direct <strong>only</strong> <code>Trace.WriteLine()</code> statements to that <code>application.log</code>?</p>
  
  <p>If not, what is the simplest way to <code>WriteLine()</code> to a file of my own only what I choose to log to that file, not my entire debug session?</p>