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!

Determining if Specific Event Logs Exist

You can use the Exists method to determine whether a specific log exists. If the log exists, the method returns true. You might use this method if you are creating a custom log and want to make sure that a log by that name does not already exist.

Note   Because the Exists method is static, you do not need to create an instance of the EventLog component before you call the method — instead, you can call the method on the EventLog class itself.

You must have registry rights in order to find out if a log exists. If you do not have the appropriate rights, the query will always return false. For information on setting registry rights, see your Windows documentation.

To determine if an event log exists

See Also

Administering Event Logs | Creating and Removing Custom Event Logs