Trace to event log : Debug Trace « Development Class « C# / C Sharp

C# / C Sharp
1. 2D Graphics
2. Class Interface
3. Collections Data Structure
4. Components
5. Data Types
6. Database ADO.net
7. Design Patterns
8. Development Class
9. Event
10. File Stream
11. Generics
12. GUI Windows Form
13. Language Basics
14. LINQ
15. Network
16. Office
17. Reflection
18. Regular Expressions
19. Security
20. Services Event
21. Thread
22. Web Services
23. Windows
24. XML
25. XML LINQ
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C# / C Sharp » Development Class » Debug TraceScreenshots 
Trace to event log

/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: gmacbeth@comporium.net
 * Create Date: June 27, 2003
 * Last Modified Date:
 * Version: 1
 */
using System;
using System.IO;
using System.Diagnostics;


namespace Client.Chapter_16___Debugging
{
  public class TracingToEventLog
  {
    [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");

      
        }
  }

}

           
       
Related examples in the same category
1. Using BooleanSwitchUsing BooleanSwitch
2. Debug class
3. Debug and ProfileDebug and Profile
4. Trace to debuger: writeline and flush
5. Trace class: listener and writeline
6. Tracing To A File
7. Tracing Example
8. demonstrates debug outputdemonstrates debug output
9. illustrate the use of the debuggerillustrate the use of the debugger
10. A simple demonstration of the Debug class
11. Demonstrate indenting debug messages
12. Demonstrates routing debug messages to a fileDemonstrates routing debug messages to a file
13. Defensive Programming:Conditional Methods
14. Debug and Trace Output
15. Using Switches to Control Debug and Trace:BooleanSwitch
16. Using Switches to Control Debug and Trace:TraceSwitch
17. Using Switches to Control Debug and Trace:User-Defined Switch
ww__w_.__j___a_va2___s__._c__o___m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.