# Windows event log

**URL:** <https://forum.inductiveautomation.com/t/windows-event-log/11083>\
**Category:** Archived Topics\
**Created:** [January 21, 2016, 9:37am UTC](https://forum.inductiveautomation.com/t/windows-event-log/11083 "2016-01-21T09:37:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amolinse](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@amolinse](https://forum.inductiveautomation.com/u/amolinse)\
**Post date:** [January 21, 2016, 9:37am UTC](https://forum.inductiveautomation.com/t/windows-event-log/11083/1 "2016-01-21T09:37:45Z")

</div>

I would like to know if it is possible to write a log in windows event logs using a python script. I found some an script that can do that:

win32evtlogutil.ReportEvent(applicationName, eventID, eventCategory=category,  
eventType=myType, strings=descr, data=data, sid=my\_sid)

the problem is that I need to import win32evtlogutil and it seems that py32win library is not installed.  
Have you any idea how to solve my problem?

Tanks in advance.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 21, 2016, 1:15pm UTC](https://forum.inductiveautomation.com/t/windows-event-log/11083/2 "2016-01-21T13:15:12Z")

</div>

You can only use python modules in jython if they are pure python – native library bindings won’t work. In these situations, you must look for a similar java approach to the problem, or spawn an executable that can do what you want. There are several possible approaches listed on [stack overflow](http://stackoverflow.com/questions/164879/how-to-write-from-java-to-the-windows-event-log).  
{ I haven’t done any of this, largely because I treat Windows like the plague. 🙂 }

---

<div class="post-metadata">

**Author:** ![amolinse](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@amolinse](https://forum.inductiveautomation.com/u/amolinse)\
**Post date:** [January 22, 2016, 12:23pm UTC](https://forum.inductiveautomation.com/t/windows-event-log/11083/3 "2016-01-22T12:23:21Z")

</div>

thanks for the information pturmel.

At the end I had to use a batch file that run a vbs to write a log in windows log viewer. It is not a very nice solution but at least it is working 😃
