Here is the sample code!!

MSDN Library References:

Web.Config Code Snippets
<system.diagnostics>
     <assert logfilename="c:\inetpub\wwwroot\Tracing\assert.log" /> 
     <switches>
          <add name="DataMessagesSwitch" value="1" />
          <add name="TraceLevelSwitch" value="2" />
      </switches>
      <trace autoflush="true" indentsize="2">
          <listeners>
               <add name="traceListener"
                         type="System.Diagnostics.TextWriterTraceListener" 
                         initializeData="c:\inetpub\wwwroot\Tracing\myLog.log" />
               <add name="traceListener"
                         type="System.Diagnostics.EventLogTraceListener" 
                         initializeData="Msdn Tracing" />
           </listeners>
        </trace>
</system.diagnostics>