转载,原文出处:https://blog.csdn.net/wawa8899/article/details/54408060

环境:CentOS6.7 + Apache2.4 + Django1.8

背景:早前对apache日志按天进行了分割,每天日志文件大小很稳定。最近发现apache错误日志文件巨大,每天都打印很多很多行[wsgi:error]

[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

[Python] Django+Apache 报 [wsgi:error]问题解决相关推荐

  1. python Django,报错Reverse for ‘topics‘ not found. ‘topics‘ is not a valid view function…解决方法

    最近学习python编程从入门到实践这本书,因此在学习到第18章关于Django的章节产生的问题困扰的时间是目前最久的. 如下图所示: 经过搜索,终于发现了问题所在:learning_logs\url ...

  2. Python PIP Mysql-python 报错 ERROR: Command errored out with exit status 1: python setup.py egg_info C

    pip install mysql-python 安装Mysql-python时,报错,先看下错误内容: ERROR: Command errored out with exit status 1:c ...

  3. Python安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法

    我们在使用 pip 安装 python 包时,经常会出现如下错误: ERROR: Could not find a version that satisfies the requirement xxx ...

  4. python pip 安装报错 error in setup command: use_2to3 is invalid. 解决方法

    问题 安装anyjson==0.3.3这个库,其他库也有可能发生 error in anyjson setup command: use_2to3 is invalid. 解决 pip install ...

  5. python gui Gooey 报错 error: argument command: invalid choice:

    运行程序时报错: usage: main_gui_batcmm.py [-h] {Run Reset} ... main_gui_batcmm.py: error: argument command: ...

  6. python 导包报错:ERROR: Could not find a version that satisfies the requirement dateutil

    terminal执行脚本: pip install python-dateutil

  7. Python项目运行报错 django.core.exceptions.ImproperlyConfigured: WSGI application ‘WebTool.wsgi.application

    问题描述:使用Pycharm运行python项目报错:django.core.exceptions.ImproperlyConfigured: WSGI application 'WebTool.ws ...

  8. python class函数报错_Python multiprocess pool模块报错pickling error问题解决方法分析

    本文实例讲述了Python multiprocess pool模块报错pickling error问题解决方法.分享给大家供大家参考,具体如下: 问题 之前在调用class内的函数用multiproc ...

  9. python redis模块connectionerror_ConnectionError:Error 2连接到Python/Django Redis中的unix套接字...

    我正在尝试在一个全新的Mac上运行一个django项目.它一直工作到昨天,我不知道发生了什么,但突然间我开始收到Redis错误.在 我可以加载不查询数据库的页面,但是一旦我尝试进行搜索(部分依赖于Re ...

最新文章

  1. 一文提升你对深度学习分布式训练的整体认知!
  2. 为什么 Python被Google选为TensorFlow的开发语言呢?使用 Python比C++语言进行机器学习有什么优势?
  3. 三、开发调试应用程序
  4. JavaScript的常用工具汇总
  5. Perl学习之四:语句(续)
  6. 数组(ArrayList)底层怎样扩容
  7. delphi7存取配置文件与sqlserver数据库连接_SQL Server基础知识概念要点详细讲解
  8. 天宫初级认证答案_百度初级认证试题答案
  9. wshttpbinding java_WCF自定义用户账号密码之WCF系结模式wsHttpBinding的Java调用
  10. SDEBECMSrv服务
  11. C语言强化——学生管理系统
  12. vSphere 7 With K8s系列07:客户端工具使用
  13. Visual Assist X Options 常用宏
  14. Python经典编程习题100例,供初学者学习
  15. 企业微信API使用基本教程
  16. android locat
  17. Ignition Gazebo Fortress LTS试用
  18. 谱聚类(Spectral Clustering)算法介绍
  19. Runtime.getRuntime().availableProcessors()
  20. 【数据库数据恢复】linux操作系统下MYSQL数据库恢复案例

热门文章

  1. 宝塔面板备份网站方法
  2. 【bzoj1222】[HNOI2001]产品加工 背包dp
  3. for语句与if语句嵌套的简单应用
  4. Nginx使用教程(七):使用Nginx缓存之proxy cache
  5. WebSocket实践
  6. 1014-新浪微博(数据 cell )
  7. C#实现浮动和多标签窗体解决方案---使用Dockpanel
  8. MySQL_自定义函数
  9. 2012,新的一年,新的开始
  10. TS Annotation