Trouble writing to EventLog

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Trouble writing to EventLog

    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 Guest

  2. Similar Questions and Discussions

    1. Eventlog problems
      Hi All, I'm writing an webservice and want to log errors etc. and thoughed the Eventlog would be a nice place for it. The problem is that i can't...
    2. Security Exception when writting to EventLog
      When trying to execute the following code in a web service, I get the enclosed error. Everyone has full control do the registry and Security System...
    3. SecurityException on EventLog.CreateEventSource
      Hi All, Can anybody tell me how to write to the application event log with a new source. I'm running the .Net example code but can't get it to...
    4. EventLog access through ASP.Net app
      I have an ASP.Net app for which I want to be able to log events to the Windows 2000 server event log under a special log name. I encountered the...
    5. [ANN] win32-eventlog 0.1.0
      Hi all, I'm happy to announce the first release of win32-eventlog. This is a Ruby interface to the Win32 EventLog. Synopsis ========...
  3. #2

    Default Re: Trouble writing to EventLog

    By adding rights, you also create security holes.

    From everything I have read, registry access is only required when
    creating a new source in the event log. Even the almost-neutered ASPNET
    account should be able to write to the event log if it does not have to
    register a new source.

    One of my other projects does this successfully.

    Any other ideas?

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Eric Johannsen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139