title: Problem with System.Diagnosis.TextWriterTraceListener not writing any log to the filesystem
body: <p>To solve an issue with sending e-mail through a smtp-server where e-mails are not getting sent, I was adviced to enable logging using System.Diagnosis.TextWriterTraceListener to trace the communication with the smtp-server to track any errors. I added the following to my web.config under the  node:</p>
  
  <pre><code>&lt;system.diagnostics&gt;
        &lt;trace autoflush="true" /&gt;
        &lt;sources&gt;
          &lt;source name="System.Net" &gt;
            &lt;listeners&gt;
              &lt;add name="MyTraceFile"/&gt;
            &lt;/listeners&gt;
          &lt;/source&gt;
  
          &lt;source name="System.Net.Sockets"&gt;
            &lt;listeners&gt;
              &lt;add name="MyTraceFile"/&gt;
            &lt;/listeners&gt;
          &lt;/source&gt;
        &lt;/sources&gt;
  
        &lt;sharedListeners&gt;
          &lt;add
            name="MyTraceFile"
            type="System.Diagnostics.TextWriterTraceListener"
            initializeData="System.Net.trace.log"                /&gt;
        &lt;/sharedListeners&gt;
  
        &lt;switches&gt;
          &lt;add name="System.Net" value="Verbose" /&gt;
          &lt;add name="System.Net.Sockets" value="Verbose" /&gt;
        &lt;/switches&gt;
      &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p>I tried it out on my development machine and it worked just fine! I could easely read out the complete communication with the smtp-server. However, at the production environment (running on IIS 6 in Windows 2003 Server), it does not work at all. No log is getting written to the filesystem. My first thought was that perhaps the ASP.NET worker process account (NETWORK SERVICE) did not have sufficient rights to write to the filesystem at the specified location. I fixed that, but still get no log. Second, I thought that perhaps the folder was set to "read only" and fixed that as well. But still I get no log written.</p>
  
  <p>Do anyone have an idea what the problem might be? Or perhaps some advice on how I could fix this? Thanx in advance! </p>