Skip to content

Commit

Permalink
Log address and port, show exception trace from uvicorn.run
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaretnikov committed Dec 16, 2023
1 parent 5e4e2e5 commit 26e28bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions conda-store-server/conda_store_server/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ def start(self):
process.start()

try:
# Note: the logger needs to be defined here for the output to show
# up, self.log doesn't work here either
logger = logging.getLogger("app")
logger.setLevel(self.log_level)
logger.info(f"Starting server on {self.address}:{self.port}")

uvicorn.run(
fastapi_app,
host=self.address,
Expand All @@ -376,6 +382,11 @@ def start(self):
else []
),
)
except:
import traceback

traceback.print_exc()
raise
finally:
if self.standalone:
process.join()

0 comments on commit 26e28bc

Please sign in to comment.