Apache2 WSGI日志记录全部显示为错误
这可能只是对一个简单设置的疏忽,但我的apache错误日志一直是这样填写的:Apache2 WSGI日志记录全部显示为错误,apache,logging,python-2.7,mod-wsgi,apache2.2,Apache,Logging,Python 2.7,Mod Wsgi,Apache2.2,这可能只是对一个简单设置的疏忽,但我的apache错误日志一直是这样填写的: [Thu Oct 04 19:23:12 2012] [error] INFO:render.image_utils:aggdraw not available, using PIL native 出现了多个类似的日志,但下面是此日志的代码: log = logging.getLogger("render.image_utils") try: import aggdraw log.info("usin
[Thu Oct 04 19:23:12 2012] [error] INFO:render.image_utils:aggdraw not available, using PIL native
出现了多个类似的日志,但下面是此日志的代码:
log = logging.getLogger("render.image_utils")
try:
import aggdraw
log.info("using aggdraw for point rendering")
except:
log.info("aggdraw not available, using PIL native")
我希望它将消息分类为apache日志中的info,而不是后面带有info一词的错误。我需要什么来让日志工作?如果还有什么我需要提供的,请告诉我。提前谢谢。您无法更改此设置。Python日志模块对C级apacheapi一无所知,也无权访问该API以在特定的日志级别记录消息。它所能做的就是将日志输出发送到stderr,然后在错误级别将其路由到Apache日志系统
换句话说,这是一个必须接受的限制,除非您打算为Python编写一个特殊的C扩展模块,该模块可以挂接到Apache C级API中进行日志记录。如果这对社区有足够的帮助,我可能会这样做。谢谢。:)