Problem using win32evtlogutil.ReportEvent()

Josef Sachs sachs at panix.com
Thu Aug 8 12:34:13 EDT 2002


I'm trying to do "custom event log writing"
(as per p. 360 of _Python Programming on Win32_) like so:

win32evtlogutil.AddSourceToRegistry(self._svc_name_)
win32evtlogutil.ReportEvent(
  self._svc_name_, # Application name
  servicemanager.PYS_SERVICE_STARTED, # Event ID
  0, # Event category
  win32evtlog.EVENTLOG_INFORMATION_TYPE,
  (self._svc_name_, "") # The inserts
  )

...but the description that I get in the event detail is:
The description for Event ID ( 4098 ) in Source ( Whatever ) could not
be found. It contains the following insertion string(s): Whatever, .

Has anyone gotten this to work?  Could you please post sample code?
I notice that this problem was posted in Dec 2000 and again this past
Jan-Feb, but I didn't see any solutions.

Thanks in advance.



More information about the Python-list mailing list