My system:
MSW XP professional
Python 2.3.3
logging package: 0.4.9.2
My problem:
The log_test3.py script, provided with the logging package distribution,
generates an unexpected message:
No handlers could be found for logger "root"
Here is the complete trace from running the log_test3.py script:
========================================
C:\projects\logging-0.4.9.2\test>log_test3.py
Traceback (most recent call last):
File "C:\Python23\Lib\site-packages\logging\config.py", line 111, in
fileConfig
h = apply(klass, args)
File "C:\Python23\Lib\site-packages\logging\handlers.py", line 559, in
__init__
self._welu.AddSourceToRegistry(appname, dllname, logtype)
File "C:\Python23\Lib\site-packages\win32\lib\win32evtlogutil.py", line
35, in AddSourceToRegistry
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s \\%s" % (eventLogType,
appName))
error: (5, 'RegCreateKey', 'Access is denied.')
---------------------------------------------------
-- Logging to root; messages appear on console only
---------------------------------------------------
No handlers could be found for logger "root"
----------------------------------------------------------------------
-- Logging to log02; messages appear on console and in file python.log
----------------------------------------------------------------------
--------------------------------------------------------------------------
-- Logging to log02.log03; messages appear on console, in file python.log,
-- and at logrecv.py tcp (if running. <= DEBUG messages will not appear).
--------------------------------------------------------------------------
-----------------------------------------------------------------------
-- Logging to log02.log03.log04; messages appear only at logrecv.py udp
-- (if running. <= INFO messages will not appear).
-----------------------------------------------------------------------
--------------------------------------------------------------------
-- Logging to log02.log03.log04.log05.log06; messages appear at
-- logrecv.py udp (if running. < CRITICAL messages will not appear).
--------------------------------------------------------------------
-- All done.
========================================
I expect the Windows NT EventLog handler to fail since I am running under an
account that does not have Windows Registry update privileges.
However, I did not expect to see the message:
No handlers could be found for logger "root"
Also, I have not been able to get a demo script to work that uses
logging.config.fileConfig with custom handlers I have written. Is this
permissable? If so, how? Here is a sample error I'm seeing:
NameError: name 'Details_Log' is not defined
-- jv