grillazz / fastapi-sqlalchemy-asyncpg

Integration of FastAPI framework supported by Pydantic with SQLAlchemy ORM and PostgreSQL on asyncpg driver
MIT License
415 stars 57 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__)? #161

Closed sanwei111 closed 3 months ago

sanwei111 commented 4 months ago

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?