Trouble writing to EventLog

Discussion in 'ASP .Net' started by Eric Johannsen, Aug 10, 2003.

  1. 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"
    }
    }
     
    Eric Johannsen, Aug 10, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. omoore

    Writing to Windows EventLog

    omoore, Aug 20, 2004, in forum: Perl
    Replies:
    0
    Views:
    518
    omoore
    Aug 20, 2004
  2. David Conorozzo
    Replies:
    5
    Views:
    11,352
    David Conorozzo
    Dec 15, 2003
  3. Anders Both

    Writing to eventlog from asp.net

    Anders Both, Feb 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    580
    Anders Both
    Feb 23, 2004
  4. Marauderz
    Replies:
    2
    Views:
    436
    Marauderz
    Jul 28, 2004
  5. MattC

    Writing to the EventLog

    MattC, Oct 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    534
    Scott Allen
    Nov 2, 2004
Loading...

Share This Page