How to delete a custom event log source?

  • Thread starter Thread starter Frank Powell
  • Start date Start date
F

Frank Powell

Does anyone have any idea how to remove a custom event
log source? It was created as part of a programming
exercise in a book I'm reading. Now I can't seem to find
a way to delete it. I suppose there isn't any harm in
leaving it but I'd rather get rid of it if possible.
 
How to delete your custom EVent log

Hi

go to [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog]
and delete your custom log folder
 
That's very helpful; thanks a lot! I would add that for me the custom-log key also appeared in [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog], so it's probably worth checking all of them (ControlSet001, ControlSet002 etc.) and deleting the key wherever you find it.

Cheers,

Ed Graham
 
Instead of editing the registry it is better to create and delete eventlogs using the .net class
System.Diagnostics.EventLog.

If Microsoft decides to change the method your software will still work.

Create the eventLog
Use the static function System.Diagnostics.Eventlog.CreateEventSource
There are several versions of this function. One of the parameters is the string LogName

Delete the eventLog
Use the static function System.Diagnostics.Eventlog.DeleteEventSource
Use the same LogName that was used to create the event source

Look up the class EventLog to see how to write to the event log
 
Back
Top