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

[FEATURE] Logging for production service #559

Open
2 tasks done
colinatkepler opened this issue Oct 31, 2024 · 0 comments
Open
2 tasks done

[FEATURE] Logging for production service #559

colinatkepler opened this issue Oct 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@colinatkepler
Copy link

colinatkepler commented Oct 31, 2024

If you'd like to discuss your feature idea first with the community (highly recommended!) please visit our Discord channel.

Is your feature request related to a problem? Please describe.
using the standard logging, e.g.

import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.debug("TEST")

doesn't work when using serve() or even uvicorn.run() or uvicorn main:app....

Describe the solution you'd like
I was able to solve it by inspecting uvicorn's logging configuration and just naming all my loggers uvicorn, e.g. in each module logger = logging.getLogger("uvicorn"), but it would be nice to be able to use the standard logging idiom.

Example code
See above.

Problem solved
Explain what problem this feature would solve and how it would benefit users of the library:
It would allow users to use logging for production.

Additional context
It seems this is a tricky problem for uvicorn in general, probably because of things running async, because a lot of people have a hard time getting uvicorn logging to work apparently.

Confirmation
Please confirm the following:

  • I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
  • I have read the project's documentation to ensure this feature doesn't already exist.
@colinatkepler colinatkepler added the enhancement New feature or request label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant