Skip to content

Commit 8c64591

Browse files
committed
修复uwsgi日志问题
1 parent b22a80a commit 8c64591

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1. 修改`build.sh``docker-compose.yml`中镜像版本,执行`sh build.sh`构建镜像
1010
2. 执行`docker-compose up -d`启动容器
1111
3. 执行`docker exec -it flask-api-demo bash`进入容器
12-
4. 执行`supervisorctl stop app`停止服务,并执行`flask run``python wsgi.py`进入开发者模式
12+
4. 执行`supervisorctl stop webapp`停止服务,并执行`flask run``python wsgi.py`进入开发者模式
1313
5.`CHANGELOG.md`中记录版本日志,重新执行第一步发布镜像
1414

1515
## 运维调试
@@ -18,12 +18,12 @@
1818

1919
```bash
2020
# supervisorctl status
21-
app RUNNING pid 8, uptime 3 days, 5:35:50
21+
webapp RUNNING pid 8, uptime 3 days, 5:35:50
2222
worker RUNNING pid 10, uptime 3 days, 5:35:50
2323
```
2424

25-
2. 停止进程:`supervisorctl stop app`
26-
3. 启动进程:`supervisorctl start app`
25+
2. 停止进程:`supervisorctl stop webapp`
26+
3. 启动进程:`supervisorctl start webapp`
2727
4. 查看日志:`tail -f /data/log/webapp.log`
2828
5. 查看日志:`tail -f /data/log/worker.log`
2929

conf/supervisor.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[program:app]
1+
[program:webapp]
22
command = uwsgi /work/conf/uwsgi.ini
33
autostart = true
44
autorestart = true
55
# 将stderr的日志写入stdout日志文件中
66
redirect_stderr = true
7-
stdout_logfile = /data/log/supervisor.log
7+
stdout_logfile = /data/log/webapp.log
88
# 杀死进程组包括子进程
99
stopasgroup = true
1010
killasgroup = true

conf/uwsgi.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ enable-threads = true
1515

1616
pidfile = /tmp/uwsgi.pid
1717
# 指定日志文件
18-
logto = /data/log/webapp.log
18+
;logto = /data/log/webapp.log
1919
# 输出到控制台
20-
;log-master = true
20+
log-master = true
2121
harakiri = $(HTTP_TIMEOUT)
2222
http-timeout = $(HTTP_TIMEOUT)

0 commit comments

Comments
 (0)