Cannot write to event log when web application uses forms authentication



Hi. I have created a web application. When using authentication
mode="Windows", writing to the events log (which I created in a
console application that was run as administrator.) works ok.
However, when I use forms authentication, it doesn't write to the
events log anymore. There are no error messages on the page displayed,
nor in the application log or security log. I have tried the following
(individually and separately), but none of it works (For your
information, the newly created event log name is "MyApp", the
eventSource is also "MyApp").

1. For the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
\Eventlog\MyApp, I have granted full control for the user "ASPNET".

Then grant the permission on the file C:\windows\system32\config
\MyApp.evt to be full control for ASPNET.

2. For the key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\MyApp, I
have granted full control for the user "NETWORK SERVICE".

Then grant the permission on the file C:\windows\system32\config
\MyApp.evt to be full control for NETWORK SERVICE.


3. Append the value of the CustomSD key in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\MyApp
with

(A;;0x3;;;NS)

4. Add in <identity impersonate="true"/> in the web.config
and then append the value of the CustomSD key in


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\MyApp
with

(A;;0x3;;;AU).


Any help is appreciated. Thanks.

-Andrew
.