Hi all
I'm still getting acquinted with the Python in general and the logging
module in particular. After flailing around initially, I managed to
get my way around logging in Turbogears using the FileHandler and the
standard outputs (I concur with one of the earlier posts here that the
Turbogears documentation is vague at best and pretty confusing at
worst...and no, I am not new to log4j and come from the Java world
but still found the documentation incomplete.)
Anyways, I was trying to set up an SMTPHandler to be able to send
error messages to an email. I thought I'd set that up using the same
way I set up the FileHandler but with different arguments. Well, I get
parser error when doing that. Here is my attempt:
[[loggers]]
[[[my_app]]]
qualname='my_app'
level='DEBUG'
handlers=['mydebug_out','myerror_out']
[[handlers]]
[[[mydebug_out]]]
level='DEBUG'
args="('debug.log',)"
class='FileHandler'
formatter='full_content'
[[[myerror_out]]]
level='ERROR'
class='SMTPHandler' (also tried handlers.SMTPHandler)
args="('
xx.yy.com','
mya...@yy.com',['
m...@yy.com'],"App Error Log',)"
formatter='full_content'
The intention is to send all log output (DEBUG and above) to debug.log
and email all ERROR logs to a given email.
The above gives this error:
File "./start-rbuls.py", line 20, in <module>
modulename="rbuls.config")
File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/config.py", line 206, in update_config
configdict = config_obj(configfile, modulename).dict()
File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/config.py", line 192, in config_obj
configdata2 = ConfigObj(configfile, unrepr=True)
File "/usr/lib/python2.5/site-packages/configobj-4.5.2-py2.5.egg/
configobj.py", line 1272, in __init__
File "/usr/lib/python2.5/site-packages/configobj-4.5.2-py2.5.egg/
configobj.py", line 1355, in _load
configobj.UnreprError: Parse error in value at line 109.
Any ideas? Is SMTPHandler unsupported in Turbogears? Any pointers or a
working config file would be of great help.
TIA,
C Vora