Search code examples
c#visual-studio-2010event-logevent-viewer

What's the difference between using EventLog .NET type and having eventLog registry entry?


Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.

  1. Does anybody knows about "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\XXX\" registry entry?

  2. Who uses this assembly and how it is used?

  3. What is the preferred method? Using EventLog type or the registry entry? Or is this question even valid?

-Datte


Solution

  • I prefer using the EventLogInstaller and create the event log sources using installutil explicitly.

    About who uses the assembly, I guess whoever wants to write to the EventLog. Keep in mind that there are other ways to write to the EventLog from .NET applications that use instrumentation manifests. Take a look at the System.Diagnostics.Eventing namespace.