views:

133

answers:

2

I am trying to get the new System.Diagnostics.Eventing event logging working in a simple .Net app before integrating it into my application.

Working off of this page, I created a manifest, built a simple app that fires an event and registered the provider to see it in the event viewer. I don't get any errors in event viewer or my sample app (the provider IsEnabled and WriteEvent returns true), but the events never show up.

Is there something I'm missing? Or some likely causes that I can check?

A: 

It is probably due to lack of rights.

The user identity making the call needs to have the right to write to the event log.

Which user identity is making the call is dependent upon IIS settings, web.config and identity of the application pool.

Shiraz Bhaiji
IIS and web.config doesn't factor into this. This is a console application. But it sounds like there are additional rights I need to set somewhere?
For reference: The event _thinks_ it's being written successfully (a return value of true from WriteEvent) and is not throwing any access or security exceptions
May be it is writing to a file and the event view is not automatically picking up the file. See http://msdn.microsoft.com/en-us/library/aa363690(VS.85).aspx
Shiraz Bhaiji
+1  A: 

Try giving 'Read' permission for 'NetworkService' user to the whole 'EventLog' registry branch (it's at HKLM\System\ControlSet\CurrentControlSet\Services\EventLog).

Firenzi