Could someone help me figure out a potential problem with my logging
configuration?
This section in turbogears.config shows the following: (I apologize
for the length, but I thought I might cut out vital clue if I posted
only snippets)
def _get_handlers(handlers, formatters):
for key, handler in handlers.items():
kw = {}
try:
cls = handler.get("class")
args = handler.get("args", tuple())
level = handler.get("level", None)
try:
cls = eval(cls, logging.__dict__)
--------------------
* Here is my config:
[logging]
[[handlers]]
[[[access_out]]]
# set the filename as the first argument below
args="('/var/log/openerp-web.access',)"
class='FileHandler'
level='DEBUG'
formatter='message_only'
[[[error_out]]]
args="('/var/log/openerp-web.error')"
class='FileHandler'
level='DEBUG'
formatter='message_only'
[[loggers]]
[[[openerp]]]
level='DEBUG'
qualname='openerp'
handlers=['error_out']
[[[access]]]
level='DEBUG'
qualname='turbogears.access'
handlers=['access_out']
propagate=0
--------------------
* logging.__dict__ contains 27 different entries, included at the
bottom of this post. I receive upon attempt to eval for FileHandler
the following exception:
turbogears.config.ConfigError: Missing or wrong argument to
FileHandler in handler access_out -> [Errno 13] Permission denied: '/
var/log/openerp-web.access'
File "/home/jgalyon/workingcopies/openerp/web/start-openerp-web.py",
line 15, in <module>
start()
File "/home/jgalyon/workingcopies/openerp/web/openerp/commands.py",
line 54, in start
modulename="openerp.config")
File "/usr/lib/python2.5/site-packages/TurboGears-1.1b1-py2.5.egg/
turbogears/config.py", line 219, in update_config
configure_loggers(configdict)
File "/usr/lib/python2.5/site-packages/TurboGears-1.1b1-py2.5.egg/
turbogears/config.py", line 141, in configure_loggers
_get_handlers(handlers, formatters)
File "/usr/lib/python2.5/site-packages/TurboGears-1.1b1-py2.5.egg/
turbogears/config.py", line 48, in _get_handlers
"%s in handler %s -> %s " % (cls.__name__,key,err))
-------------------
* logging.__dict__: (buckle up, its big)
{'cStringIO': <module 'cStringIO' from '/usr/lib/python2.5/lib-dynload/
cStringIO.so'>, '_lock': <_RLock(None, 0)>, '_handlers': {},
'setLoggerClass': <function setLoggerClass at 0x860741c>, 'ERROR': 40,
'critical': <function critical at 0x86d08ec>, 'Filterer': <class
logging.Filterer at 0x867eb9c>, '_acquireLock': <function _acquireLock
at 0x860779c>, '__path__': ['/usr/lib/python2.5/logging'],
'_loggerClass': <class logging.Logger at 0x86cf29c>, 'Handler': <class
logging.Handler at 0x86cf14c>, 'LogRecord': <class logging.LogRecord
at 0x8609a4c>, 'shutdown': <function shutdown at 0x86d0aac>,
'handlers': <module 'logging.handlers' from '/usr/lib/python2.5/
logging/handlers.pyc'>, 'Logger': <class logging.Logger at 0x86cf29c>,
'Formatter': <class logging.Formatter at 0x8481e3c>, 'BASIC_FORMAT': '%
(levelname)s:%(name)s:%(message)s', 'getLevelName': <function
getLevelName at 0x8607684>, 'Filter': <class logging.Filter at
0x867e8fc>, 'logProcesses': 1, 'FATAL': 50, 'addLevelName': <function
addLevelName at 0x86077d4>, 'log': <function log at 0x86d0a3c>,
'getLogger': <function getLogger at 0x86d08b4>, 'FileHandler': <class
logging.FileHandler at 0x86cf05c>, 'WARNING': 30, 'error': <function
error at 0x86d0924>, '_startTime': 1224772636.4748001, 'CRITICAL': 50,
'StreamHandler': <class logging.StreamHandler at 0x86cf32c>,
'__version__': '0.5.0.2', '__doc__': "\nLogging package for Python.
Based on PEP 282 and comments thereto in\ncomp.lang.python, and
influenced by Apache's log4j system.\n\nShould work under Python
versions >= 1.5.2, except that source line\ninformation is not
available unless 'sys._getframe()' is.\n\nCopyright (C) 2001-2007
Vinay Sajip. All Rights Reserved.\n\nTo use, simply 'import logging'
and log away!\n", 'currentframe': <function <lambda> at 0x86076f4>,
'info': <function info at 0x86d09cc>, 'INFO': 20, 'string': <module
'string' from '/usr/lib/python2.5/string.pyc'>, '_defaultFormatter':
<logging.Formatter instance at 0x853b14c>, '__builtins__': {'Inde
xError': <type 'exceptions.IndexError'>, 'all': <built-in function
all>, 'help': Type help() for interactive help, or help(object) for
help about object., 'vars': <built-in function vars>, 'SyntaxError':
<type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>,
'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>,
'isinstance': <built-in function isinstance>, 'copyright': Copyright
(c) 2001-2008 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'NameError': <type 'exceptions.NameError'>,
'dict': <type 'dict'>, 'input': <built-in function input>, 'oct':
<built-in function oct>, 'SystemExit': <type 'exceptions.SystemExit'>,
'StandardError': <type 'exceptions.StandardError'>, 'repr': <built-in
function repr>, 'sorted': <built-in function sorted>, 'False': False,
'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'list': <type
'list'>, 'iter': <built-in function iter>, 'reload': <built-in
function reload>, 'Warning': <type 'exceptions.Warning'>, 'round':
<built-in function round>, 'dir': <built-in function dir>, 'cmp':
<built-in function cmp>, 'set': <type 'set'>, 'reduce': <built-in
function reduce>, 'intern': <built-in function intern>, 'issubclass':
<built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError':
<type 'exceptions.EOFError'>, 'locals': <built-in function locals>,
'slice': <type 'slice'>, 'FloatingPointError': <type
'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'get
attr': <built-in function getattr>, 'abs': <built-in function abs>,
'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'True': True,
'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning':
<type 'exceptions.ImportWarning'>, 'None': None, 'hash': <built-in
function hash>, 'len': <built-in function len>, 'credits': Thanks
to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more
information., 'frozenset': <type 'frozenset'>, '__name__':
'__builtin__', 'ord': <built-in function ord>, 'super': <type
'super'>, '_': None, 'TypeError': <type 'exceptions.TypeError'>,
'license': Type license() to see the full license text,
'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>,
'UserWarning': <type 'exceptions.UserWarning'>, 'filter': <built-in
function filter>, 'range': <built-in function range>, 'staticmethod':
<type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>,
'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in
function pow>, 'RuntimeError': <type 'exceptions.RuntimeError'>,
'float': <type 'float'>, 'MemoryError': <type
'exceptions.MemoryError'>, 'StopIteration': <type
'exceptions.StopIteration'>, 'globals': <built-in function globals>,
'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>,
'apply': <built-in function apply>, 'LookupError':
<type 'exceptions.LookupError'>, 'open': <built-in function open>,
'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'basestring': <type
'basestring'>, 'UnicodeError': <type 'exceptions.UnicodeError'>,
'zip': <built-in function zip>, 'hex': <built-in function hex>,
'long': <type 'long'>, 'ReferenceError': <type
'exceptions.ReferenceError'>, 'ImportError': <type
'exceptions.ImportError'>, 'chr': <built-in function chr>, 'xrange':
<type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in
functions, exceptions, and other objects.\n\nNoteworthy: None is the
`nil' object; Ellipsis represents `...' in slices.", 'Exception':
<type 'exceptions.Exception'>, 'tuple': <type 'tuple'>,
'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>,
'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type
'exceptions.UnicodeEncodeError'>, 'IOError': <type
'exceptions.IOError'>, 'hasattr': <built-in function hasattr>,
'delattr': <built-in function delattr>, 'setattr': <built-in function
setat
tr>, 'raw_input': <built-in function raw_input>, 'SyntaxWarning':
<type 'exceptions.SyntaxWarning'>, 'compile': <built-in function
compile>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>,
'str': <type 'str'>, 'property': <type 'property'>, 'GeneratorExit':
<type 'exceptions.GeneratorExit'>, 'int': <type 'int'>, '__import__':
<built-in function wingdb_import_hook>, 'KeyError': <type
'exceptions.KeyError'>, 'coerce': <built-in function coerce>,
'PendingDeprecationWarning': <type
'exceptions.PendingDeprecationWarning'>, 'file': <type 'file'>,
'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr':
<built-in function unichr>, 'any': <built-in function any>, 'OSError':
<type 'exceptions.OSError'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'min': <built-in function min>,
'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'execfile':
<built-in function execfile>, 'id': <built-in function id>, 'complex':
<type 'complex'>, 'bool': <type 'bool'>, 'Valu
eError': <type 'exceptions.ValueError'>, 'NotImplemented':
NotImplemented, 'map': <built-in function map>, 'buffer': <type
'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>,
'TabError': <type 'exceptions.TabError'>, 'callable': <built-in
function callable>, 'ZeroDivisionError': <type
'exceptions.ZeroDivisionError'>, 'eval': <built-in function eval>,
'__debug__': True, 'IndentationError': <type
'exceptions.IndentationError'>, 'AssertionError': <type
'exceptions.AssertionError'>, 'ustr': <function ustr at 0x8399a04>,
'classmethod': <type 'classmethod'>, 'UnboundLocalError': <type
'exceptions.UnboundLocalError'>, 'NotImplementedError': <type
'exceptions.NotImplementedError'>, 'AttributeError': <type
'exceptions.AttributeError'>, 'OverflowError': <type
'exceptions.OverflowError'>}, '__file__': '/usr/lib/python2.5/logging/
__init__.pyc', '_releaseLock': <function _releaseLock at 0x860725c>,
'exception': <function exception at 0x86d095c>, '__author__': 'Vinay
Sajip <vinay_s
[EMAIL PROTECTED]>', 'sys': <module 'sys' (built-in)>, 'disable':
<function disable at 0x86d0a74>, 'warn': <function warning at
0x86d0994>, 'codecs': <module 'codecs' from '/usr/lib/python2.5/
codecs.pyc'>, 'DEBUG': 10, '__name__': 'logging', 'logThreads': 1,
'PlaceHolder': <class logging.PlaceHolder at 0x86cf20c>, 'types':
<module 'types' from '/usr/lib/python2.5/types.pyc'>, '__status__':
'production', 'WARN': 30, 'BufferingFormatter': <class
logging.BufferingFormatter at 0x867e95c>, 'NOTSET': 0, '_srcfile': '/
usr/lib/python2.5/logging/__init__.py', 'thread': <module
'thread' (built-in)>, 'atexit': <module 'atexit' from '/usr/lib/
python2.5/atexit.pyc'>, 'root': <logging.RootLogger instance at
0x8638e4c>, 'makeLogRecord': <function makeLogRecord at 0x8607224>,
'traceback': <module 'traceback' from '/usr/lib/python2.5/
traceback.pyc'>, 'fatal': <function critical at 0x86d08ec>,
'_levelNames': {0: 'NOTSET', 'INFO': 20, 'WARNING': 30, 40: 'ERROR',
10: 'DEBUG', 'WARN': 30, 50: 'CRITICAL', '
CRITICAL': 50, 20: 'INFO', 'ERROR': 40, 'DEBUG': 10, 'NOTSET': 0, 30:
'WARNING'}, 'raiseExceptions': 1, '__date__': '16 February 2007',
'threading': <module 'threading' from '/usr/lib/python2.5/
threading.pyc'>, 'Manager': <class logging.Manager at 0x86cf0ec>,
'warning': <function warning at 0x86d0994>, 'getLoggerClass':
<function getLoggerClass at 0x84a1684>, 'basicConfig': <function
basicConfig at 0x84ba5dc>, 'time': <module 'time' from '/usr/lib/
python2.5/lib-dynload/time.so'>, 'debug': <function debug at
0x86d0a04>, 'os': <module 'os' from '/usr/lib/python2.5/os.pyc'>,
'_handlerList': [], 'RootLogger': <class logging.RootLogger at
0x86cf0bc>}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---