Clear Trace Listener and Add EventLogTraceListener : Trace Listener : Development C# Examples


C# Examples » Development » Trace Listener »

 

Clear Trace Listener and Add EventLogTraceListener









    
using  System;
using  System.Diagnostics;

using  System.Collections;

using  System.Data;
using  System.Text;

public  class  MainClass{
      public  static  void  Main(){
          Trace.Listeners.Clear();  //  clear  all  listeners
          Trace.Listeners.Add(new  EventLogTraceListener("BugRiddenLog"));
          Debug.Assert(1  ==  0,"Error!","Error:  1  ==  0");
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Trace Listener