Re: windows service with its own event log
- From: Bennie Haelen <bhaelen@xxxxxxxxx>
- Date: Mon, 22 Aug 2005 19:41:59 -0700
Hi John,
In order to create a new Event Source, you need to be a member of the Administrators group. One workaround is to have a separate program that creates the source for you, then you can run just this program from an admin account, and your service can still run under "non-admin" credentials.
Regards,
Bennie Haelen
John Grandy wrote:
Unless I make the account under which my Windows Service runs a member of local Administrators, I get startup failures if I include the following code in the OnStart() event :
if(!EventLog.SourceExists("MyLog")) { EventLog.CreateEventSource("My Log", "Application"); } EventLog appLog = new EventLog(); appLog.Source = eventSource; appLog.WriteEntry("Test Log Entry",EventLogEntryType.Information);
Seems extreme to make a Service's credentials a member of local Administrators ... any ideas ?
.
- References:
- windows service with its own event log
- From: John Grandy
- windows service with its own event log
- Prev by Date: Achitecture of a C# application
- Next by Date: RE: System Timer Puzzle
- Previous by thread: windows service with its own event log
- Next by thread: Namespaces
- Index(es):
Relevant Pages
|