Friday 17 July 2009

Writing an event log entry from an ASP.NET application

By default the ASPNET account under which ASP.NET applications cannot write to the registry. So if you are writing an event log entry with a new source it will fail.

The simple answer is to run regedit and go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application

Then create a new key with the name of your event source.

Full details can be found here.