def cherrypy_logging(log_path, log_handler):
 log = cherrypy.log
 log.access_file = ''
 log.error_file = ''
 maxBytes = getattr(log, 'rot_maxBytes', 524288)
 backupCount = getattr(log, 'rot_backupCount', 3)
 fname = getattr(log, 'rot_error_file', log_path)
 h = log_handler(fname, 'a', maxBytes, backupCount)
 h.setLevel(logging.DEBUG)
 h.setFormatter(cherrypy._cplogging.logfmt)
 log.error_log.addHandler(h)

def cherrypy_logging ( log_path , log_handler ) : log = cherrypy . log log . access_file = '' log . error_file = '' maxBytes = getattr ( log , 'rot_maxBytes' , 524288 ) backupCount = getattr ( log , 'rot_backupCount' , 3 ) fname = getattr ( log , 'rot_error_file' , log_path ) h = log_handler ( fname , 'a' , maxBytes , backupCount ) h . setLevel ( logging . DEBUG ) h . setFormatter ( cherrypy . _cplogging . logfmt ) log . error_log . addHandler ( h )
setup cherrypy logging .