encode / uvicorn

An ASGI web server, for Python. 🦄
https://www.uvicorn.org/
BSD 3-Clause "New" or "Revised" License
8.11k stars 701 forks source link

what's the relationship between "log_config" in uvicorn.run('main:app', host="127.0.0.1", port=8051, log_config="log.ini") and logging.getLogger(__name__)? #2365

Closed sanwei111 closed 2 weeks ago

sanwei111 commented 2 weeks ago

Initial Checks

Discussion Link

hello,sir.
i wtite a log.ini,pass it for the para of log_config in  uvicorn.run('main:app', host="127.0.0.1", port=8051, log_config="log.ini").

besides, i initializes class of logger by:self._logger = logging.getLogger(__name__) in some file.

i found that the log generated by self._logger can be found in the log file defined by "log_config".

so,question is:
 1. why?
 2. how can i output some dynamic log to the log file formally?

Description

111111111111111111

Example Code

111111111111111

Python, Uvicorn & OS Version

1111111111111111

[!IMPORTANT]

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.

Fund with Polar

Kludex commented 2 weeks ago

Please create a discussion.