import logging
import logging.handlers
def get_configured_logger(name):
global logger
logger = logging.getLogger(name)
if len(logger.handlers) == 0:
fh = logging.FileHandler(os.path.join('/'.join(os.path.realpath(__file__).split('/')[:-3]),
'logs/system.log'))
formatter = logging.Formatter('%(asctime)s - %(levelname)s %(message)s')
fh.setFormatter(formatter)
logger.addHandler(fh)
logger.setLevel(logging.DEBUG)
return logger
logger = get_configured_logger('web2py.app.system')
The code needs to be in model not in modules.
Could anyone explain why ?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.