Click to See Complete Forum and Search --> : How do you delete a log from the Event Viewer?


Mike Pliam
July 16th, 2008, 03:31 PM
I have been experimenting with a bunch of Window Services. Consequently, I have a whole bunch of useless logs in the Event Viewer.

These logs were instantiated using code like:


Diagnostics::EventLog^ log ;
if (! Diagnostics::EventLog::SourceExists(L"MySvc4Service") )
{
Diagnostics::EventLog::CreateEventSource(L"MySvc4Service", "MySvc4Log");
}
log = ( gcnew Diagnostics::EventLog(L"MySvc4Log") );
log->Source = L"MySvc4Service";


The Event Viewer has menu options for clearing the entries, cloning, saving, and deleting the cloned logs. But I cannot figure out how to clean up the Event Viewer and get rid of the useless old log files.