Tracing To EventLog : Trace : Development C# Examples


C# Examples » Development » Trace »

 

Tracing To EventLog









    
using  System;
using  System.IO;
using  System.Diagnostics;

class  MainClass
{
    [STAThread]
    static  void  Main(string[]  args)
    {
        //You  can  change  the  listener  with  the  following  code
        EventLogTraceListener  EventListener  =  new  EventLogTraceListener("MyApp");

        Trace.Listeners.Add(EventListener);
        
        Trace.WriteLine("My  Trace  String  To  Console");

        
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Trace