You can delete any event log on your local computer or a remote server, provided you have the appropriate registry rights. When you delete a log, the system first deletes the file that contains the log's contents and then accesses the registry and removes all of the event sources that were registered for that log. Even if you re-create the log at a later point, you will not be able to re-register the event sources without reinstalling the applications that created them, so some applications that previously were able to write entries to that log will not be able to write to the new log.
You must have registry rights on the machine on which you want to delete a log. For more information, see your Windows documentation.
Note Recreating an event log can be a difficult process. It is good practice to not delete any of the system-created event logs, such as the Application log. You can delete your custom logs and recreate them as needed.
To delete an event log on the local machine
[Visual Basic] EventLog.Delete ("MyCustomLog") [C#] EventLog.Delete ("MyCustomLog");
Note Because the Delete 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.
To delete an event log on a remote machine
[Visual Basic] EventLog.Delete ("MyCustomLog", "myremotemachine") [C#] EventLog.Delete ("MyCustomLog", "myremotemachine");
Note Because the Delete 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.