Writing to the Event Log

Thus far I have been using console applications to simplify the examples. However, you are more likely to use .NET Remoting for WinForms, WebForms, or NT Service applications. For debugging and tracing information for these applications you can use the event log. Chapter 17 gives more information on using the EventLog class for logging application events, but I'll mention it here briefly.

The easiest way to log application events is to invoke the shared method EventLog.WriteEntry, passing the event source and message to write. The event source is a unique name across all event logs, and the message is whatever text you want to appear in the log entry. By default, information will be written to the Application log. (Refer to Chapter 17 to read about creating custom logs and writing log entries to remote machines.)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.9.148