title: How to use TraceSource.TraceEvent in a ASP.NET C# web application
body: <p>I am required to use <strong>TraceSource.TraceEvent</strong> in an web application I am developing, after reading <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.tracesource.traceevent.aspx" rel="nofollow">this</a> and <a href="http://msdn.microsoft.com/en-us/library/ytz3xayy.aspx" rel="nofollow">this</a> msdn links</p>
  
  <p>I am working on a project that is already built, I am making changes to it and updating it.</p>
  
  <p><strong>This is how my web.config is defined.</strong></p>
  
  <pre><code>&lt;system.diagnostics&gt;
  &lt;sources&gt;
      &lt;listeners&gt;
      &lt;clear/&gt;
      &lt;add name="xml"/&gt;
    &lt;/listeners&gt;
  &lt;/sources&gt;
  
  &lt;sharedListeners&gt;
    &lt;add name="xml" type="System.Diagnostics.XmlWriterTraceListener"
                             traceOutputOptions="Callstack,LogicalOperationStack,ProcessId"
                             initializeData="C:\logs\Test.svclog"/&gt;
  &lt;/sharedListeners&gt;
  
  &lt;trace autoflush="true" /&gt;
  
   &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p><strong>The code that I am trying to use</strong></p>
  
  <pre><code>var traceSource = new TraceSource("TraceSourceName");
  traceSource.TraceEvent(TraceEventType.Error, 2, "Hello World !");
  </code></pre>
  
  <p>But no logging is done to Test.svclog file, I have created an empty file Test.svclog under the C:\logs\ folder.</p>
  
  <p>Please help me out on this.</p>