Django+Apache 报 [wsgi:error]问题解决
2017-09-28 14:54
375 查看
环境:CentOS6.7 + Apache2.4 + Django1.8
背景:早前对apache日志按天进行了分割,每天日志文件大小很稳定。最近发现apache错误日志文件巨大,每天都打印很多很多行[wsgi:error]
[plain] view
plain copy
[Mon Dec 26 08:24:58.245875 2016] [wsgi:error] [pid 24768:tid 140371390662400] 17
[Mon Dec 26 08:24:58.245891 2016] [wsgi:error] [pid 24768:tid 140371390662400] 16
[Mon Dec 26 08:24:58.245906 2016] [wsgi:error] [pid 24768:tid 140371390662400] 15
[Mon Dec 26 08:24:58.245922 2016] [wsgi:error] [pid 24768:tid 140371390662400] 14
[Mon Dec 26 08:24:58.245937 2016] [wsgi:error] [pid 24768:tid 140371390662400] 13
[Mon Dec 26 08:24:58.245953 2016] [wsgi:error] [pid 24768:tid 140371390662400] 12
[Mon Dec 26 08:24:58.245969 2016] [wsgi:error] [pid 24768:tid 140371390662400] 11
[Mon Dec 26 08:24:58.245984 2016] [wsgi:error] [pid 24768:tid 140371390662400] 10
[Mon Dec 26 08:24:58.246000 2016] [wsgi:error] [pid 24768:tid 140371390662400] 9
[Mon Dec 26 08:24:58.246015 2016] [wsgi:error] [pid 24768:tid 140371390662400] 8
[Mon Dec 26 08:24:58.246031 2016] [wsgi:error] [pid 24768:tid 140371390662400] 7
[Mon Dec 26 08:24:58.246046 2016] [wsgi:error] [pid 24768:tid 140371390662400] 6
[Mon Dec 26 08:24:58.246061 2016] [wsgi:error] [pid 24768:tid 140371390662400] 5
观察了很久,发现每一行错误日志最后的内容都是项目中打印的字段,网上查了很久,最终发现这些wsgi:error是Django代码中的print语句引起的,注释掉所有的print语句后问题解决。
参考文献:
http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html
http://serverfault.com/questions/239614/wsgi-and-python-print-statements
背景:早前对apache日志按天进行了分割,每天日志文件大小很稳定。最近发现apache错误日志文件巨大,每天都打印很多很多行[wsgi:error]
[plain] view
plain copy
[Mon Dec 26 08:24:58.245875 2016] [wsgi:error] [pid 24768:tid 140371390662400] 17
[Mon Dec 26 08:24:58.245891 2016] [wsgi:error] [pid 24768:tid 140371390662400] 16
[Mon Dec 26 08:24:58.245906 2016] [wsgi:error] [pid 24768:tid 140371390662400] 15
[Mon Dec 26 08:24:58.245922 2016] [wsgi:error] [pid 24768:tid 140371390662400] 14
[Mon Dec 26 08:24:58.245937 2016] [wsgi:error] [pid 24768:tid 140371390662400] 13
[Mon Dec 26 08:24:58.245953 2016] [wsgi:error] [pid 24768:tid 140371390662400] 12
[Mon Dec 26 08:24:58.245969 2016] [wsgi:error] [pid 24768:tid 140371390662400] 11
[Mon Dec 26 08:24:58.245984 2016] [wsgi:error] [pid 24768:tid 140371390662400] 10
[Mon Dec 26 08:24:58.246000 2016] [wsgi:error] [pid 24768:tid 140371390662400] 9
[Mon Dec 26 08:24:58.246015 2016] [wsgi:error] [pid 24768:tid 140371390662400] 8
[Mon Dec 26 08:24:58.246031 2016] [wsgi:error] [pid 24768:tid 140371390662400] 7
[Mon Dec 26 08:24:58.246046 2016] [wsgi:error] [pid 24768:tid 140371390662400] 6
[Mon Dec 26 08:24:58.246061 2016] [wsgi:error] [pid 24768:tid 140371390662400] 5
观察了很久,发现每一行错误日志最后的内容都是项目中打印的字段,网上查了很久,最终发现这些wsgi:error是Django代码中的print语句引起的,注释掉所有的print语句后问题解决。
参考文献:
http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html
http://serverfault.com/questions/239614/wsgi-and-python-print-statements
相关文章推荐
- Django+Apache 报 [wsgi:error]问题解决
- 通过django-wsgi部署在apache上碰到的问题和解决方法
- 解决编译Apache出现的问题:configure: error: APR not found . Please read the documentation
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation
- [UnicodeEncodeError]:Django中解决URL中文解释乱码问题
- 手把手教你:Ubuntu+django+apache下配置网页错误OperationalError: Unable to Open Database File 的解决方法
- 解决 apache error 指定网络名不再可用 "an unknown filter was not added: DEFLATE"的问题
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation
- django用apache+mod_wsgi部署后中文乱码的解决方法
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation
- Ubuntu12.04系统下,解决"Django Error: That port is already in use."报错问题
- apache Mercurial HTTP Error 500: Internal Server Error问题解决方法
- Error: org.apache.mahout.math.CardinalityException: Required cardinality 10 but got 30问题解决办法
- Apache 解决500 Internal Server Error 问题
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation .
- 解决编译Apache出现的问题:configure: error: APR not found . Please read the documentation
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation
- 解决编译Apache出现的问题:configure: error: APR not found . Please read the documentation
- 解决编译apache出现的问题:configure: error: APR not found . Please read the documentation