Configure a custom logging handler(such as subclass of logging.Handler) may induce errors. We could add custom logging handler in controllers.py. Considering a prod.cfg or dev.cfg as below:
[logging]
...
[[[allinfo]]]
level='INFO'
handlers=['debug_out']
[[[access]]]
level='INFO'
qualname='turbogears.access'
handlers=['access_out']
propagate=0
We could add FileHandler for allinfo by:
logging.getLogger().addHandler(logging.FileHandler('allinfo.log','a') )
and for access:
logging.getLogger("turbogears.access").addHandler(logging.FileHandler('access.log','a') )
In prod.cfg, we could direct the default logging output to NullHandler or simply left blank.
[logging]
...
[[[allinfo]]]
level='INFO'
handlers=['debug_out']
[[[access]]]
level='INFO'
qualname='turbogears.access'
handlers=['access_out']
propagate=0
We could add FileHandler for allinfo by:
logging.getLogger().addHandler(logging.FileHandler('allinfo.log','a') )
and for access:
logging.getLogger("turbogears.access").addHandler(logging.FileHandler('access.log','a') )
In prod.cfg, we could direct the default logging output to NullHandler or simply left blank.
Comments