You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
802 B
15 lines
802 B
import uvicorn
|
|
from uvicorn.config import LOGGING_CONFIG
|
|
|
|
if __name__ == "__main__":
|
|
# 修改默认日志配置
|
|
LOGGING_CONFIG["formatters"]["default"]["fmt"] = "%(asctime)s - %(levelname)s - %(message)s"
|
|
LOGGING_CONFIG["formatters"]["default"]["datefmt"] = "%Y-%m-%d %H:%M:%S"
|
|
LOGGING_CONFIG["formatters"]["access"][
|
|
"fmt"
|
|
] = '%(asctime)s - %(levelname)s - %(client_addr)s - "%(request_line)s" %(status_code)s'
|
|
LOGGING_CONFIG["formatters"]["access"]["datefmt"] = "%Y-%m-%d %H:%M:%S"
|
|
|
|
uvicorn.run("app:app", host="0.0.0.0", port=8111, reload=False, log_config=LOGGING_CONFIG, workers=5
|
|
#,ssl_keyfile="/data/docker/sh_toilet/nginx/conf/cert/www.hbcjy.com.key",ssl_certfile="/data/docker/sh_toilet/nginx/conf/cert/www.hbcjy.com.pem"
|
|
)
|
|
|