Apache2未触发的行为日志文件

时间:2015-06-23 13:27:22

标签: python logging flask apache2 wsgi

从今天开始,apache的错误日志在我给出的路径中停止写入,而不是返回到默认的日志记录文件中。

我是apache2 vhost配置,我已将ErrorLog设置为值

$ {APACHE_LOG_DIR} /ghost_error.log,

但是当记录错误时,它会在

中写入

$ {APACHE_LOG_DIR} /error.log

我们正在使用带有apache2的Flask。

有apache2的配置文件

<VirtualHost *:80>
[...]
ServerAdmin webmaster@localhost
WSGIScriptAlias / /var/www/ghost/ghost.wsgi

[...]

ErrorLog ${APACHE_LOG_DIR}/ghost_error.log
CustomLog ${APACHE_LOG_DIR}/ghost_access.log combined
</VirtualHost>

还有wsgi文件:

#!/usr/bin/python
try:
  ghost_path='/home/www'
  chdir_this = '%s/ghost/' % ghost_path
  activate_this = '%s/ghost_env/bin/activate_this.py' % ghost_path
  import os
  os.chdir(chdir_this)
  execfile(activate_this, dict(__file__=activate_this))

  reload(os)
  import sys
  import logging

  os.chdir(os.path.abspath(os.path.dirname(__file__) + "/App/"))
  sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/App/"))
  sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
  from App import app as application
except Exception, e:
  import traceback
  with open('/tmp/ghost.fail.log', 'w') as f:
    f.write("%s\n%s" % (e, traceback.format_exc()))

我们根本不知道它可以来自哪里。 如果你有一些提示要遵循!

感谢。

0 个答案:

没有答案