Logging with Apache 2.4, mod_wsgi and Django

2019-09-10 23:17发布

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?

0条回答
登录 后发表回答