Trouble writing to EventLog

E

Eric Johannsen

My aspx page can not write to the EventLog "Requested registry access is not
allowed". I have read the posts about ASPNET not having access to create
new event sources, so I created a little installer that pre-creates the
event sources. That installer writes a test entry to the event log for my
source so I can see that it has been created.

Still, the aspx page fails to write to the event log.

Any ideas?

Thanks,

Eric

TEST CODE:

btnWriteEventLog_Click(object sender, System.EventArgs e)
{
EventLog log = new EventLog();
try
{
log.Log = "MyLog";
log.Source = "MySource";
log.WriteEntry("Test", EventLogEntryType.Information);
}
catch (Exception E)
{
string s;
s = E.Message; // E.Message contains: "Requested registry access is
not allowed"
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top