title: Understanding how Trace works in C#
body: <p>I am trying to understand how does Tracing works </p>
  
  <p>I have created a simple new web project. This is my code that I can using</p>
  
  <pre><code>// Create a trace listener for the event log.
  EventLogTraceListener myTraceListener = new EventLogTraceListener("myEventLogSource");
  
  // Add the event log trace listener to the collection.
  Trace.Listeners.Add(myTraceListener);
  
  // Write output to the event log.
  Trace.WriteLine("Test output");
  </code></pre>
  
  <p>I am taking help from this <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlogtracelistener.aspx">msdn link</a></p>
  
  <p>The  settings in my web.config is as follows</p>
  
  <pre><code> &lt;system.diagnostics&gt;
   &lt;trace autoflush="false" indentsize="4"&gt;
    &lt;listeners&gt;
      &lt;add name="myListener"
        type="System.Diagnostics.EventLogTraceListener"
        initializeData="TraceListenerLog" /&gt;
    &lt;/listeners&gt;
   &lt;/trace&gt;
  &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p>However when I run this code, I dont know where this logging is happening I check the EVENT VIEWER, under the "Application and Services Log" I was expecting some new log to be created with the name "myEventLogSource" but that has not happened.</p>
  
  <p>Please can anyone explain me how this works.</p>