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

  1. #1

    Default 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 seem to
    write to my own log and source i'm getting ' Requested registry access is
    not allowed ' i have set the asp.net account to have permission on the
    registry entries but that doesn't help a bit. Writing to the Application log
    with my own source works just fine. But i want my own log so not to flood
    the Applications one!

    what can i do about that? any suggestions?

    Hopes someone can help me out,
    Richard.


    Richard Heesbeen Guest

  2. Similar Questions and Discussions

    1. Win32::EventLog problem with event ID 560
      James - Do I gather correctly that you are reading Security logs? If so, I *may* be able to help you once I get back to my ofc on Monday Feb 2. ...
    2. 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...
    3. 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...
    4. [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 ========...
    5. 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...
  3. #2

    Default Re: Eventlog problems

    When you try to write to an event log application that's not been registered,
    the API tries to create the approproate registry entry. The ASP.NET worker
    process identity doesn't have permissions to do that. You need to call EventLog.CreateEventSource
    from an administrative account first.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > 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
    > seem to write to my own log and source i'm getting ' Requested
    > registry access is not allowed ' i have set the asp.net account to
    > have permission on the registry entries but that doesn't help a bit.
    > Writing to the Application log with my own source works just fine. But
    > i want my own log so not to flood the Applications one!
    >
    > what can i do about that? any suggestions?
    >
    > Hopes someone can help me out,
    > Richard.


    Brock Allen Guest

  4. #3

    Default RE: Eventlog problems

    Hi Richard,

    Are you using System.Diagnostics? If not....

    Try using the System.Diagnostics event log handlers to output to an Event
    log. This should allow you to either specify an existing log to write to or
    create a new one, and also will give you listeners etc. to manipulate output
    tp the logs.

    HTH,
    Steve.


    "Richard Heesbeen" wrote:
    > 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 seem to
    > write to my own log and source i'm getting ' Requested registry access is
    > not allowed ' i have set the asp.net account to have permission on the
    > registry entries but that doesn't help a bit. Writing to the Application log
    > with my own source works just fine. But i want my own log so not to flood
    > the Applications one!
    >
    > what can i do about that? any suggestions?
    >
    > Hopes someone can help me out,
    > Richard.
    >
    >
    >
    Steve Guest

  5. #4

    Default Re: Eventlog problems

    Hi Brock,

    Thanks for your time,

    I have created the entries in an installer class with CreateEventSource
    like:

    EventLog.CreateEventSource ( "MyLog", "MyLog" );

    So the entries in the registry are there, but when i try to write to them in
    the webservice with:

    EventLog Log = new EventLog();
    Log.Log = "MyLog";
    Log.Source = "MyLog";
    Log.WriteEntry ( ... );

    Then i get the Exception, doing that in the installer works just fine, also
    to my own source in the Application log works fine.

    Any more suggestions?
    Richard.

    "Brock Allen" <ballen@NOSPAMdevelop.com> schreef in bericht
    news:857033632538534839528256@msnews.microsoft.com ...
    > When you try to write to an event log application that's not been
    > registered, the API tries to create the approproate registry entry. The
    > ASP.NET worker process identity doesn't have permissions to do that. You
    > need to call EventLog.CreateEventSource from an administrative account
    > first.
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    >> 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
    >> seem to write to my own log and source i'm getting ' Requested
    >> registry access is not allowed ' i have set the asp.net account to
    >> have permission on the registry entries but that doesn't help a bit.
    >> Writing to the Application log with my own source works just fine. But
    >> i want my own log so not to flood the Applications one!
    >>
    >> what can i do about that? any suggestions?
    >>
    >> Hopes someone can help me out,
    >> Richard.
    >
    >
    >

    Richard Heesbeen Guest

  6. #5

    Default Re: Eventlog problems

    Hi Steve,

    Thanks for your time,

    I use the following code in the webservice:

    using System.Diagnostics;

    EventLog Log = new EventLog();
    Log.Log = "MyLog";
    Log.Source = "MyLog";
    Log.WriteEntry ( ... );

    Is this ok? Or i'm i doing something wrong here?

    Richard.

    "Steve" <Steve@discussions.microsoft.com> schreef in bericht
    news:63C8EA3C-2346-4034-A36F-B6F282E5A4EB@microsoft.com...
    > Hi Richard,
    >
    > Are you using System.Diagnostics? If not....
    >
    > Try using the System.Diagnostics event log handlers to output to an Event
    > log. This should allow you to either specify an existing log to write to
    > or
    > create a new one, and also will give you listeners etc. to manipulate
    > output
    > tp the logs.
    >
    > HTH,
    > Steve.
    >
    >
    > "Richard Heesbeen" wrote:
    >
    >> 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 seem
    >> to
    >> write to my own log and source i'm getting ' Requested registry access is
    >> not allowed ' i have set the asp.net account to have permission on the
    >> registry entries but that doesn't help a bit. Writing to the Application
    >> log
    >> with my own source works just fine. But i want my own log so not to flood
    >> the Applications one!
    >>
    >> what can i do about that? any suggestions?
    >>
    >> Hopes someone can help me out,
    >> Richard.
    >>
    >>
    >>

    Richard Heesbeen Guest

  7. #6

    Default Re: Eventlog problems

    What exception are you getting now?

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hi Brock,
    >
    > Thanks for your time,
    >
    > I have created the entries in an installer class with
    > CreateEventSource like:
    >
    > EventLog.CreateEventSource ( "MyLog", "MyLog" );
    >
    > So the entries in the registry are there, but when i try to write to
    > them in the webservice with:
    >
    > EventLog Log = new EventLog();
    > Log.Log = "MyLog";
    > Log.Source = "MyLog";
    > Log.WriteEntry ( ... );
    > Then i get the Exception, doing that in the installer works just fine,
    > also to my own source in the Application log works fine.
    >
    > Any more suggestions?
    > Richard.
    > "Brock Allen" <ballen@NOSPAMdevelop.com> schreef in bericht
    > news:857033632538534839528256@msnews.microsoft.com ...
    >
    >> When you try to write to an event log application that's not been
    >> registered, the API tries to create the approproate registry entry.
    >> The ASP.NET worker process identity doesn't have permissions to do
    >> that. You need to call EventLog.CreateEventSource from an
    >> administrative account first.
    >>
    >> -Brock
    >> DevelopMentor
    >> [url]http://staff.develop.com/ballen[/url]
    >>> 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 seem to write to my own log and source i'm getting ' Requested
    >>> registry access is not allowed ' i have set the asp.net account to
    >>> have permission on the registry entries but that doesn't help a bit.
    >>> Writing to the Application log with my own source works just fine.
    >>> But i want my own log so not to flood the Applications one!
    >>>
    >>> what can i do about that? any suggestions?
    >>>
    >>> Hopes someone can help me out,
    >>> Richard.


    Brock Allen Guest

  8. #7

    Default Re: Eventlog problems

    I figured it out, a source name needs to be unique, may not exist in any
    other log.

    Thanks for your time,
    Richard.

    "Brock Allen" <ballen@NOSPAMdevelop.com> schreef in bericht
    news:862301632539190625608032@msnews.microsoft.com ...
    > What exception are you getting now?
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    >> Hi Brock,
    >>
    >> Thanks for your time,
    >>
    >> I have created the entries in an installer class with
    >> CreateEventSource like:
    >>
    >> EventLog.CreateEventSource ( "MyLog", "MyLog" );
    >>
    >> So the entries in the registry are there, but when i try to write to
    >> them in the webservice with:
    >>
    >> EventLog Log = new EventLog();
    >> Log.Log = "MyLog";
    >> Log.Source = "MyLog";
    >> Log.WriteEntry ( ... );
    >> Then i get the Exception, doing that in the installer works just fine,
    >> also to my own source in the Application log works fine.
    >>
    >> Any more suggestions?
    >> Richard.
    >> "Brock Allen" <ballen@NOSPAMdevelop.com> schreef in bericht
    >> news:857033632538534839528256@msnews.microsoft.com ...
    >>
    >>> When you try to write to an event log application that's not been
    >>> registered, the API tries to create the approproate registry entry.
    >>> The ASP.NET worker process identity doesn't have permissions to do
    >>> that. You need to call EventLog.CreateEventSource from an
    >>> administrative account first.
    >>>
    >>> -Brock
    >>> DevelopMentor
    >>> [url]http://staff.develop.com/ballen[/url]
    >>>> 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 seem to write to my own log and source i'm getting ' Requested
    >>>> registry access is not allowed ' i have set the asp.net account to
    >>>> have permission on the registry entries but that doesn't help a bit.
    >>>> Writing to the Application log with my own source works just fine.
    >>>> But i want my own log so not to flood the Applications one!
    >>>>
    >>>> what can i do about that? any suggestions?
    >>>>
    >>>> Hopes someone can help me out,
    >>>> Richard.
    >
    >
    >

    Richard Heesbeen 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