沉默樱桃 [英] Silencing cherrypy

查看:46
本文介绍了沉默樱桃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很好的服务器,可以将xml文件分发到网页.当我的服务器运行时,cherrypy为每个已请求的网页提供日志,说明时间戳记和url.对于通常的使用来说,这是一个相当不错的功能,但是当请求每秒达到10个以上的请求时,日志可能会变得过多.尤其是当我尝试滚动它们以查找一些重要的调试信息时.当不必要的日志填满历史缓冲区以删除调试信息时,效果会更好.

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.

推荐答案

请参见 CherryPy文档记录.

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

这篇关于沉默樱桃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆