Skip to content
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

'quart.app' vs 'app' for log level configuration via dictConfig #334

Open
cheeseypi opened this issue Apr 25, 2024 · 1 comment
Open

'quart.app' vs 'app' for log level configuration via dictConfig #334

cheeseypi opened this issue Apr 25, 2024 · 1 comment

Comments

@cheeseypi
Copy link

Per the quart documentation, logging configuration can be provided by configuring a logger called 'quart.app' via dictConfig. However, I've found that the log level pulled from current_app.logger uses the name 'app', rather than 'quart.app', and can therefore only be configured by setting 'app' up in dictConfig.

Example:
I would expect a configuration that looks like this:
image
to configure current_app.logger with a log level of INFO, per your documentation, but it actually sets that logger to WARN, since it's using 'app'
image

Environment:

  • Python version: 3.10.13
  • Quart version: 0.19.4
@genevieve-me
Copy link

Thanks very much for figuring this out, I was about to give up on quart because I just could not get logging to work.

Trying to crudely figure out the correct logger name with

loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]

I only got

<Logger quart.app (DEBUG)>, <Logger quart (WARNING)>

(where the former was created by my attempt to follow the docs). I suppose I checked too early in execution when the app logger had not yet been created, and the quart logger is not used for app-level logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants