[python-win32] Writing event to event log...

fmml at cedval.org fmml at cedval.org
Mon Aug 9 21:33:03 CEST 2004


Hi András,

Thanks for directing me to the demo directory, found what I needed by
using ReportEvent modules. Even if I get "Event ID ( 1 ) in Source (
Application ) cannot be found" I can still post the info I needed.

Would be nice if there were some kind of generic message ID that I could
make use of, but for now this does the job.

Thanks a million,

Francois


> Hello fmml,
>
> 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:
>
> LogMsg
>   Write an specific message to the log.
>
> LogInfoMsg
>   Write an informational message to the log.
>
> LogErrorMsg
>   Write an error message to the log.
>
> LogWarningMsg
>   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,
>   András
>
>
> 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
>> event.
>
>> How can I do that, can someone show me an example...
>
>> Thanks in advance,
>
>> Francois
>> _______________________________________________
>> Python-win32 mailing list
>> Python-win32 at python.org
>> http://mail.python.org/mailman/listinfo/python-win32
>
>
>
>



More information about the Python-win32 mailing list