Silencing cherrypy

被刻印的时光 ゝ 提交于 2019-12-23 13:08:47

问题


I have a cherrypy server distributing xml files to webpages. While my server runs, cherrypy offers logs for each webpage that has been requested stating the timestamp and url. This is a fairly nice feature for typical use but with requests reaching past 10 requests per second the logs can become a bit excessive. Especially when I am trying scrolling though them all to find some important debug information. It gets even better when the unnecessary logs fill up the history buffer deleting the the debug information.

This is getting rather annoying. I am hoping there is a way to turn this off.


回答1:


See CherryPy docs on logging.

logger = cherrypy.log.access_log
logger.removeHandler(logger.handlers[0])


来源:https://stackoverflow.com/questions/11167884/silencing-cherrypy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!