Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Eventlog problems

Reply
Thread Tools

Eventlog problems

 
 
Richard Heesbeen
Guest
Posts: n/a
 
      06-08-2005
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.


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-08-2005
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
http://staff.develop.com/ballen



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




 
Reply With Quote
 
 
 
 
Steve
Guest
Posts: n/a
 
      06-09-2005
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.
>
>
>

 
Reply With Quote
 
Richard Heesbeen
Guest
Posts: n/a
 
      06-09-2005
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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) ...
> 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
> http://staff.develop.com/ballen
>
>
>
>> 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.

>
>
>



 
Reply With Quote
 
Richard Heesbeen
Guest
Posts: n/a
 
      06-09-2005
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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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.
>>
>>
>>



 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      06-09-2005
What exception are you getting now?

-Brock
DevelopMentor
http://staff.develop.com/ballen



> 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" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed) ...
>
>> 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
>> http://staff.develop.com/ballen
>>> 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.




 
Reply With Quote
 
Richard Heesbeen
Guest
Posts: n/a
 
      06-13-2005
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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) ...
> What exception are you getting now?
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> 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" <(E-Mail Removed)> schreef in bericht
>> news:(E-Mail Removed) ...
>>
>>> 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
>>> http://staff.develop.com/ballen
>>>> 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.

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to Windows EventLog omoore Perl 0 08-20-2004 01:56 PM
NT Services and EventLog problems Larry Bates Python 1 03-02-2004 07:26 PM
RE: NT Services and EventLog problems Pieter Claerhout Python 1 03-02-2004 04:10 PM
Access Right for Perlscript to Read Windows EventLog Remotely Joe Perl 1 09-29-2003 05:29 PM
Trouble writing to EventLog Eric Johannsen ASP .Net 0 08-10-2003 07:18 PM



Advertisments