Python Apache2未接受的行为日志文件
从今天起,apache的错误日志将停止在我给出的路径中写入,而是返回到默认的日志文件中 在apache2 vhost配置中,我已将ErrorLog设置为一个值 ${APACHE_LOG_DIR}/ghost_error.LOG 但是当记录错误时,它会写入 ${APACHE_LOG_DIR}/error.LOG 我们正在使用装有apache2的烧瓶 这里有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
<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()))