Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Apache2未接受的行为日志文件_Python_Logging_Flask_Apache2_Wsgi - Fatal编程技术网

Python Apache2未接受的行为日志文件

Python Apache2未接受的行为日志文件,python,logging,flask,apache2,wsgi,Python,Logging,Flask,Apache2,Wsgi,从今天起,apache的错误日志将停止在我给出的路径中写入,而是返回到默认的日志文件中 在apache2 vhost配置中,我已将ErrorLog设置为一个值 ${APACHE_LOG_DIR}/ghost_error.LOG 但是当记录错误时,它会写入 ${APACHE_LOG_DIR}/error.LOG 我们正在使用装有apache2的烧瓶 这里有apache2的配置文件 <VirtualHost *:80> [...] ServerAdmin webmaster@localh

从今天起,apache的错误日志将停止在我给出的路径中写入,而是返回到默认的日志文件中

在apache2 vhost配置中,我已将ErrorLog设置为一个值

${APACHE_LOG_DIR}/ghost_error.LOG

但是当记录错误时,它会写入

${APACHE_LOG_DIR}/error.LOG

我们正在使用装有apache2的烧瓶

这里有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>
我们根本不知道它从哪里来。 如果你有一些提示要遵循


谢谢。

如果在使用
站点可用
目录的Linux系统上,请确保
站点启用
中的引用实际上是指向
站点可用
中文件的符号链接,并且有人已将其转换为真实文件并对其进行了更改。另一种可能性是,您的
VirtualHost
不再匹配,它将返回到第一个默认值
VirtualHost
,尽管这需要它们仍然是正在运行的WSGI应用程序的映射。在重新启动apache2服务器几次后,它又被写入了正确的文件中。这是一个奇怪的故事,在我启用的站点中,它是指向可用站点文件的符号链接。
#!/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()))