Log to Windows Event log?

Software technical issues not related to any of the other categories

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
FunDeckHermit
Enthusiast
Posts: 14
Joined: Fri Apr 20, 2018 1:58 pm

Log to Windows Event log?

Post by FunDeckHermit » Mon Jun 25, 2018 3:25 pm

Hello,

I am looking for a way to write entries into the Windows event log.
The build-in log event action is only visible in the Nicelabel Control Center.

Could i use a Python or VBscript function to write to the Windows event log?

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2912
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Log to Windows Event log?

Post by Saso » Tue Jun 26, 2018 8:07 am

Yes, you can use VBScript / Python to write messages to Event log.

Google is your friend. ;-)
link link link

You can also use the command-line utility eventcreate. Run it with /? parameter for help and examples.
link link
Saso Fleiser
Senior Technical Product Specialist

FunDeckHermit
Enthusiast
Posts: 14
Joined: Fri Apr 20, 2018 1:58 pm

Re: Log to Windows Event log?

Post by FunDeckHermit » Tue Jun 26, 2018 8:35 am

Hello Saso,

I tried googling once, then I took an arrow into the knee.

But joking aside, I tried the second Python script yesterday and it didn't work.
It couldn't import the win32evtlogutil.

* NiceLabel 2017 is using IronPython right?

Edit 1: The third link has the same problem: "No module named win32api"

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2912
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Log to Windows Event log?

Post by Saso » Tue Jun 26, 2018 8:59 am

Aha, I see a fellow Skyrimer... ;-)

NiceLabel 2018 is using IronPython, true! IronPython is a .NET variant of Python.
With IronPyhton, you can use:
  • "Standard" Python modules. To use these, you have to install Python 2.7 on your desktop. Any additional modules that you add can be referenced from Python code within NiceLabel. More install info in KB article. The two modules your script does not find are installed with "Python for Windows Extensions".
  • .NET assemblies. As IronPyhton runs on .NET platform, you can also use .NET functions inside your Python code. Perhaps this official documentation can be useful?
Saso Fleiser
Senior Technical Product Specialist

Post Reply