From cd636cce2015fc1ba395b016f2e9af3c25804c68 Mon Sep 17 00:00:00 2001 From: brb Date: Thu, 13 Jul 2023 12:21:24 +0200 Subject: [PATCH] updated logging to show host ip and port --- code/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/main.py b/code/main.py index 2003c81..a40a074 100644 --- a/code/main.py +++ b/code/main.py @@ -6,6 +6,7 @@ import logging import os from configparser import ConfigParser from pathlib import Path +import socket # load default values @@ -21,7 +22,8 @@ if __name__ == '__main__': setup_logging() listen_ip = os.getenv('LISTEN_IP', default=LISTEN_IP) 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( app=app, host=listen_ip,