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.
14 lines
612 B
14 lines
612 B
3 months ago
|
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=9999, reload=True, log_config=LOGGING_CONFIG)
|