Dear list,
I have the following script that reproduces an issue I'm experiencing.
import logging, logging.handlers
def main():
ntl = logging.handlers.NTEventLogHandler("Python Logging Test")
logger = logging.getLogger("")
logger.setLevel(logging.DEBUG)
logger.addHandler(ntl)
logger.error("This is a '%s' message", "Error")
if __name__ == "__main__":
main()
The Python (2.7.x) script above writes "This is a 'Error' message" to the
Windows Event Viewer. When I run it as a script, I get the expected output.
If I convert the script to an executable via PyInstaller, I get an entry in
the event log but it says something completely different.
>> The description for Event ID ( 1 ) in Source ( Python Logging Test )
cannot be found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. You may be able to use the /AUXSOURCE= flag to retrieve this
description; see Help and Support for details. The following information is
part of the event: This is a 'Error' message. <<
This is the command I use to convert the script into an executable:
`pyinstaller.py --onefile --noconsole my_script.py` though the command line
parameters do not appear to have any impact on this behaviour and it will
suffice to just call `pyinstaller.py my_script.py`.
I would appreciate any help in understanding what is going on and how I go
about fixing this.
Thanks,
Philip
p.s. This was also posted on
Stackoverflow.
http://stackoverflow.com/questions/12784033/nteventloghandler-from-a-python-executable
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pyinstaller/-/fRLBgyK-uNwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.