Create New EventLog

  • Thread starter Thread starter Stefan
  • Start date Start date
S

Stefan

Hi NG
I try to create a new EventSource in an asp.net projetct with the following
code but I always get the error
Registry access nod allowed...
I changed the userName in the processModell of my machine.config file to
SYSTEM.
What else do I have to do?
try
{
if (!System.Diagnostics.EventLog.SourceExists(applicationName))
{
System.Diagnostics.EventLog.CreateEventSource(applicationName, "ESHOP");
}
}
catch(System.Security.SecurityException e)
{
throw new System.Security.SecurityException(e.Message);
}

tnx

stefan
 
Stefan, You can do a couple of things,

1. Change the access that the aspnet user has on your web server so that it
is allowed access to the event log.
2. Change the user under which ASP.Net runs.
3. Use impersonation for that section of code to impersonate a privileged
use while running within the ASP.Net process.
 
Back
Top