Logging with Apache 2.4, mod_wsgi and Django

点点圈 提交于 2019-12-12 02:39:22

问题


Is there a way to configure the logging with mod_wsgi and Django without losing the request information, such as remote client IP or unique log ID AND without using environ['wsgi.errors']?

I have been trying out different logging configurations for different mod_wsgi modes. I have found out that in daemon mode there is an issue which causes some logging information (related to request context) to get lost (see this SO post). This should however work in embedded mode (only prefork MPM?) and environ['wsgi.errors']. Nevertheless, I think it is a bad idea to make my applications logging dependent on the mod_wsgi...

If there is currently no way around using environ['wsgi.errors'] variable, is there a drop-in replacement/wrapper for Django logging middleware that can be used?

来源:https://stackoverflow.com/questions/38786532/logging-with-apache-2-4-mod-wsgi-and-django

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