[feat] 优化日志输出方式

This commit is contained in:
Wizerd
2023-12-14 12:11:21 +08:00
parent 5c3a893874
commit c7148cab5a
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ version: '3'
services:
backend-to-api:
image: wizerd/pandora-to-api:0.0.4
image: wizerd/pandora-to-api:0.0.5
restart: always
ports:
- "50011:33333"
@@ -14,7 +14,7 @@ services:
- ./log:/app/log
uploader:
image: wizerd/pandora-to-api:0.0.4
image: wizerd/pandora-to-api:0.0.5
restart: always
entrypoint: ["python3", "/app/upload.py"]
volumes:

View File

@@ -3,8 +3,8 @@
# 记录当前日期和时间
NOW=$(date +"%Y-%m-%d-%H-%M")
# 启动Gunicorn
exec gunicorn -w 2 --threads 2 --bind 0.0.0.0:33333 main:app --access-logfile "./log/access-${NOW}.log" --error-logfile "./log/error-${NOW}.log"
# 启动 Gunicorn 并使用 tee 命令同时输出日志到文件和控制台
exec gunicorn -w 2 --threads 2 --bind 0.0.0.0:33333 main:app --access-logfile - --error-logfile - | tee "./log/access-${NOW}.log"
# python3 ./main.py