When trying to write an event log, sometime we hit the error "Requested registry access is not allowed."
It's due to permission on registry entry for event log.
Solution:
1. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog.
2. Right-click Eventlog, and then click Permissions.
3. Add Everyone and give Full Control permission.