-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log address and port, show exception trace from uvicorn.run
#708
Conversation
✅ Deploy Preview for kaleidoscopic-dango-0cf31d canceled.
|
# 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}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move this to initialize
, then we'll be able to use self.log
. But it'll be far from where uvicorn
is actually started.
The lastResort handler is used by default. This might lead to unexpected results because the lastResort handler has the WARNING log-level. https://docs.python.org/3/library/logging.html#logging.lastResort
26e28bc
to
23e55aa
Compare
ping @dcmcand for a review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused why self.log doesn't work in the start method while it does in the initialize method, but this seems to work and adds valuable info for people. 🚀
Fixes #562.
Description
This pull request:
uvicorn.run
.Example output when the port is already in use:
Pull request checklist
Additional information