带有Apache和mod_wsgi的Django:除非设置Debug = True,否则不需要系统日志

我使用Apache Web服务器和mod_wsgi将请求转移到Django。

$ apache2ctl -v Server version: Apache/2.4.10 (Raspbian) Server built: Sep 17 2016 16:40:43 

我正在使用这个Apache网站声明Django的应用程序:

 ServerName example.com DocumentRoot /srv/webapps/myapp <Directory /srv/wepapps/myapp/mysite> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess example.com python-path=/srv/webapps/myapp:/usr/local/lib/python3.4/dist-packages:/usr/lib/python3/dist-packages WSGIProcessGroup example.com WSGIScriptAlias / /srv/webapps/myapp/mysite/wsgi.py LogLevel warn ErrorLog ${APACHE_LOG_DIR}/example.com_error.log CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined 

它工作的很好,但是如果引发一个exception,它会显示一个错误500,但是我的example.com_error.log没有任何内容。 如果我修改我的设置来设置Debug = True ,我可以在我的Web浏览器中看到错误,但也在我的/ var / log / apache2文件中。 但我真的不想在我的产品环境中保持这个设置。

你有一个想法,为什么我必须把Debug = True允许django写在系统日志上?

预先感谢您的答案,如果我的英语错误,抱歉;-)