相关疑难解决方法(0)

无法获取访问日志为gunicorn工作

我在ngninx后面跑着枪.我想将gunicorn中的错误记录到gunicorn-error.log并将日志访问到gunicorn-access.log.

我有错误日志工作,但没有访问日志,我做错了什么?

这是我的gunicorn.conf.py:

bind = '127.0.0.1:8888'
backlog = 2048
workers = 3
errorlog = '/home/my/logs/gunicorn-error.log'
accesslog = '/home/my/logs/gunicorn-access.log'
loglevel = 'debug'
proc_name = 'gunicorn-my'
pidfile = '/var/run/my.pid'
Run Code Online (Sandbox Code Playgroud)

这是运行gunicorn的脚本:

#!/bin/bash
set -e
ENV=/home/my/env/bin/activate
GUNICORN=gunicorn_django
SETTINGS_PATH=/home/my/app/app/settings
PROJECT_PATH=/home/my/app
CONFROOT=/home/my/app/conf/gunicorn.conf.py

cd $SETTINGS_PATH
source $ENV
export PYTHONPATH=$PROJECT_PATH
exec $GUNICORN app.settings.staging -c $CONFROOT
Run Code Online (Sandbox Code Playgroud)

它创建gunicorn-error.log和gunicorn-access.log,但只有gunicorn-error.log获取任何日志,例如:

2012-11-20 11:49:57 [27817] [INFO] Starting gunicorn 0.14.6
2012-11-20 11:49:57 [27817] [DEBUG] Arbiter booted
2012-11-20 11:49:57 [27817] [INFO] Listening at: http://127.0.0.1:8888 (27817)
2012-11-20 11:49:57 [27817] [INFO] Using worker: sync
2012-11-20 11:49:58 [27825] [INFO] …
Run Code Online (Sandbox Code Playgroud)

logging gunicorn

24
推荐指数
2
解决办法
2万
查看次数

标签 统计

gunicorn ×1

logging ×1