updated logging to show host ip and port
This commit is contained in:
+3
-1
@@ -6,6 +6,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import socket
|
||||||
|
|
||||||
|
|
||||||
# load default values
|
# load default values
|
||||||
@@ -21,7 +22,8 @@ if __name__ == '__main__':
|
|||||||
setup_logging()
|
setup_logging()
|
||||||
listen_ip = os.getenv('LISTEN_IP', default=LISTEN_IP)
|
listen_ip = os.getenv('LISTEN_IP', default=LISTEN_IP)
|
||||||
listen_port = int(os.getenv('LISTEN_PORT', default=LISTEN_PORT))
|
listen_port = int(os.getenv('LISTEN_PORT', default=LISTEN_PORT))
|
||||||
logging.info(f'starting FastAPI server ({listen_ip}:{listen_port})')
|
own_ip = socket.gethostbyname(socket.gethostname())
|
||||||
|
logging.info(f'starting FastAPI server ({own_ip}:{listen_port})')
|
||||||
uvicorn.run(
|
uvicorn.run(
|
||||||
app=app,
|
app=app,
|
||||||
host=listen_ip,
|
host=listen_ip,
|
||||||
|
|||||||
Reference in New Issue
Block a user