[python-win32] Writing event to event log...
Imre András Róbert
beast at ludens.elte.hu
Mon Aug 9 03:39:34 CEST 2004
The ReportEvent method is a decent one to try,
you may find in in win32evtlogutil.py.
The servicemanager module contains some simple
methods for this as well:
Write an specific message to the log.
Write an informational message to the log.
Write an error message to the log.
Logs a generic warning message to the event log.
Supposed you installed pywin32, you could have a look at
these in use in demos under <python home>\Lib\site-packages\win32\Demos
directory. Especially eventLogDemo.py and service\pipeTestService.py.
That's a good starting point. Should you need to define your own
categories and event IDs, things will get harder. If still interested,
you may find an ongoing discussion on this topic in the following thread
here: [Windows service features and Python]
Hope this helps,
Sunday, August 8, 2004, 2:24:19 PM, you wrote:
> Hi all,
> I am looking for a way to write to the windows event log, abritrary
> events. For example, I have written a script that check the presense of
> certain processes, if one of them is not present, I want to write an
> How can I do that, can someone show me an example...
> Thanks in advance,
> Python-win32 mailing list
> Python-win32 at python.org
More information about the Python-win32