Hi :)

I use Python 2.7 on win10 and pywin32 223. I want to log messqages to the EventLog:

dllname = os.path.dirname(__file__)
ntl = NTEventLogHandler("Python Logging Test", dllname=dllname)
logger = logging.getLogger("")
logger.setLevel(logging.DEBUG)
logger.addHandler(ntl)

logger.error("This is a '%s' message", "Error")




But I get:

Traceback (most recent call last):
  File "fpp_user_import.py", line 44, in <module>
    ntl = NTEventLogHandler("Python Logging Test", dllname=dllname)
  File "C:\Python27\lib\logging\handlers.py", line 987, in __init__
    self._welu.AddSourceToRegistry(appname, dllname, logtype)
File "C:\Python27\lib\site-packages\win32\lib\win32evtlogutil.py", line 42, in AddSourceToRegistry
    msgDLL)
pywintypes.error: (5, 'RegSetValueEx', 'Zugriff verweigert')



If I run the script with Admin privs, it is working.

How to log as "normal" user? Am I missing something?

Thanks in advance!
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to