NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Adding Your Application as a Source of Event Log Entries

Before your component can write an entry to an event log, you must register it with the event log as a valid source of events. You can do this by using the CreateEventSource method and specifying a string that uniquely identifies your component to the event log. When you write a log entry, the system uses the source you identified to find the appropriate log in which to place your entry. Your EventLog component can write to only a single log at a time.

Note   By default, if you try to write an entry without first having registered your component as a valid source, the source is automatically registered with the event log, using the value of the Source property as the source string.

If you specify the name of a log that does not exist when you use the CreateEventSource method, the system creates a new, custom event log for you with that name. For more information, see Creating and Removing Custom Event Logs.

To establish your component as an event source on the local computer

To establish your component as an event source on a remote computer

See Also

Determining Whether an Event Source Exists | Removing an Event Source | Introduction to the EventLog Component  | Creating and Removing Custom Event Logs