title: Activating logging for a Winform Application
body: <p>I came across this: <a href="https://stackoverflow.com/questions/11409264/winforms-logging-framework">Winforms logging framework</a></p>
  
  <p>But, I cannot get it working.</p>
  
  <p>In the app.config, I have the following:</p>
  
  <pre><code>&lt;system.diagnostics&gt;
      &lt;trace autoflush="false" indentsize="4"&gt;
        &lt;listeners&gt;
          &lt;add name="yourName" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\mylogfile.txt" /&gt;
        &lt;/listeners&gt;
      &lt;/trace&gt;
  &lt;/system.diagnostics
  </code></pre>
  
  <p>In my code, I have the following to write to the log file:</p>
  
  <pre><code>Trace.Write("test");
  Trace.TraceError("There's been an error captain: {0}", e);
  Trace.TraceWarning("The system broke but don't worry.");
  Trace.TraceInformation("Starting up the engines.");
  </code></pre>
  
  <p>The file is created. But nothing is written to it. Trace is turned on in visual studio.</p>
  
  <p>Not sure what is missing here.</p>