EventLog.Source & Service Programs

From: MAL (irreverence2381_at_hotmail.com)
Date: 06/29/04


Date: 28 Jun 2004 23:21:37 -0700

Hello,

I am writing a service program that writes to a custom EventLog. I
would like the two classes used in the service to write messages to
the same log ideally using a different Source name for filtering etc.

So far I am having little luck. I feel that I have been through the
documentation extensively but am chasing my tail. It seems like it
should be as simple as .CreateEventSource in each class I want to
write to the custom log, but to no avail.

When I tried to just add one class to the service program, the service
program wrote to the Application Log and the class wrote to the custom
one, even though the service seemed to have created the log. (Based on
a 5 minute timer before "Newing" my class) (.AutoLog = False) The code
is straight from the service program and EventLog walkthroughs (which
I end up using to clean things up (RemoveSource(s), DeleteLog) before
my next service removal and reboot.

The last thing I tried was creating a seperate EventLog in each class
and trying to associate the source with the log the service created. I
have attemted to pass a reference to the EventLog to the classes and
then change the source like in the multithreaded examples. I have
tried to bring the service pgms EventLog into scope in the classes.
AHHHHHHH!!!

I am obviously making this harder that it needs to be.

Thanks for reading this rant. Please advise.



Relevant Pages

  • Re: EventLog.Source & Service Programs
    ... David Williams [VB.NET MVP] ... > I am writing a service program that writes to a custom EventLog. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Service, Requested registry access is not allowed
    ... write to a custom event log and work fun running under Network Service. ... LocalSystem everything seems to work just fine. ... In that case you don't even need the installer. ... Service needs to write to a customized eventlog. ...
    (microsoft.public.dotnet.security)
  • Re: SCSI miniport-Custom Log messages
    ... Use this API-Functions for error logging in eventlog instead of your ... Make sure that you use the custom build step for your .mc file: ... Also make the necessary entries in the registry by your inf file. ... After installing this driver, an event is getting logged in the event log, ...
    (microsoft.public.development.device.drivers)
  • RE: .NET 1.1 created event log has only "Not available" properties
    ... are several missing registry values for the .NET created event logs. ... I understanding you're using the EventLog class to ... write entries into custom eventlog in .net 1.1 application. ... // Write an informational entry to the event log. ...
    (microsoft.public.dotnet.framework)