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. Advertisements

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. Joe
    Replies:
    1
    Views:
    705
    Thomas Kratz
    Sep 29, 2003
  2. omoore

    Writing to Windows EventLog

    omoore, Aug 20, 2004, in forum: Perl
    Replies:
    0
    Views:
    616
    omoore
    Aug 20, 2004
  3. David Conorozzo
    Replies:
    5
    Views:
    11,911
    David Conorozzo
    Dec 15, 2003
  4. Anders Both

    Writing to eventlog from asp.net

    Anders Both, Feb 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    677
    Anders Both
    Feb 23, 2004
  5. Marauderz
    Replies:
    2
    Views:
    507
    Marauderz
    Jul 28, 2004
  6. MattC

    Writing to the EventLog

    MattC, Oct 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    782
    Scott Allen
    Nov 2, 2004
  7. Leszek

    Writing to eventlog

    Leszek, Jan 18, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    471
    Leszek
    Jan 19, 2006
  8. DJ

    Writing to EventLog

    DJ, Aug 29, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    404
Loading...