Discussion:
windows log to event viewer
Arulnambi Nandagoban
2014-10-17 09:59:48 UTC
Permalink
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.



--

nambi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141017/c9431eaa/attachment.html>
Irmen de Jong
2014-10-17 17:15:22 UTC
Permalink
Post by Arulnambi Nandagoban
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
Mark Lawrence
2014-10-17 18:56:02 UTC
Permalink
Post by Arulnambi Nandagoban
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.
--
nambi
http://stackoverflow.com/questions/113007/writing-to-the-windows-logs-in-python
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence
Continue reading on narkive:
Loading...