Question

Is there an event log source that's always available for writing by an ASP.NET webapp?

Backstory, in case anyone has a seemingly unrelated solution:

Our ASP.NET webapp uses its own event log source, but it doesn't have the rights to create it. So, if the event log source doesn't exist when the webapp tries to write the entry (install instructions dictate that the admin register the event log source manually, but......) , our webapp doesn't put anything in the event log when it has problems.

I'm hoping there's another (app-agnostic) source I can use to notify the folks who watch the event log.

Was it helpful?

Solution 4

The "ASP.NET X.Y.Z.0" source will, I think, always be available for writing.

OTHER TIPS

In this KB article it explains the issue http://support.microsoft.com/kb/329291

If you use the second approach under the resolution you should get it to work.

If you don't want to do that or you can't get it to work correctly another way would be to use the identity tag in your web.config and impersonate a user that does have rights to edit the registry. This is a security whole only for this application but if you implement some extra security measures you should be fine.

Considered email notification? I guess some admins prefer to be notified from their cellphones.

You could also ring home (call a web service to write log back to your own server), in case the client refuse to create a key under HKLM\System\CurrentControlSet\Services\EventLog\

You might not have access to create an event source from the web app, but if memory serves, you can check to see if one exists.

In the global.asax or a custom handler, check to see if they created it like they were supposed to. If they didn't, have a really annoying reminder div show on every page. As soon as they create it like they were supposed to, the div goes away :)

You should be able to write to the built-in event logs (Application, Security, System) without much difficulty.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top