windows log to event viewer

Irmen de Jong irmen.NOSPAM at xs4all.nl
Fri Oct 17 13:15:22 EDT 2014


On 17-10-2014 11:59, Arulnambi Nandagoban wrote:
> Hello,
> 
>  
> 
> I am trying to run a tcp server as a windows service.
> 
> The project also includes an application layer protocol somewhat like CoAP and few soap
> calls to data base.
> 
> There is some moment the code enter into exception during a soap method call. This
> exception is not viewed in
> 
> Windows event viewer. Should I specify somewhere to log these exception in windows event
> viewer. Or, give me some suggestion how to log some
> 
> Critical message in windows log.
> 

What I would try is to catch the exception and log it, including a message, to the NT
Event log. You should be able to do this using the NTEventLogHandler from Python's
standard logging module, see:

https://docs.python.org/3.4/library/logging.handlers.html#logging.handlers.NTEventLogHandler


Irmen




More information about the Python-list mailing list