Q : Error While Writing to CUSTOM EventLog

  • Thread starter Thread starter Marauderz
  • Start date Start date
M

Marauderz

OK this just seems to be a common question being asked around here, I've
tried Google Grouping the question but I still haven't came up with a
solution yet. So here goes...

I'm getting the Security Exception about being Unable to Access a Registry
Key when trying to write to my custom event log.

the Eventlog I'm trying to write to, has already been created via an
Installer class

I've already given the ASPNET user fullaccess to both the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog and
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\MyEventLog
keys

and I STILL can't write to the log... reading seems to be fine though.

So... any ideas guys?

Thanks.
 
The problem is on the first time the application writes to the EventLog with
the new "MyEventLog" string (Adding the new entry).

The easiest way is to manually add an entry to your registry at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\My
EventLog

Just copy on of the existing entries for the inner values.

Hope it helps.
 
Nope, there are already entries in the event log written by another program.
So the log is not empty.
Thanks.
 
Back
Top