-
Notifications
You must be signed in to change notification settings - Fork 186
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
Uvicorn logging settings #531
Conversation
Hey @pablobgar , Thanks for opening this PR! It's really great to see these community-driven efforts. Just so that I understand a bit more about Uvicorn's logging config file, wouldn't those settings apply to every logging handler configured in the process? Or does Uvicorn filter out the handlers and formatters to only apply the ones that it will use? Looking at this issue, I can see that the logging config file seems quite generic, so I'd assume that it gets applied globally? |
Hi @adriangonz, Thanks for your answer. You are right, this logging config file is applied globally. Uvicorn applies it by calling python's logging.config.fileConfig which applies it globally. Anyway, in the file you can specify that the configuration affects only certain loggers, here you can see an example of it. Maybe this is not a good solution, I know it can be quite confusing. We can try to find a way to make a more generic approach to allow users to configure custom handlers on all application loggers. Any ideas? |
Hey @pablobgar , Thanks for that clarification! Based on that, would it make sense to change the setting name to |
Hello @adriangonz, I agree we should change the name to logging_settings. I think it would be a good idea to explicitly apply the configuration ourselves to avoid having that dependency with Uvicorn. In any case, we have to apply it in Uvicorn as well. I have made a new commit to rename the variable and to apply the configuration file on logging.py. At now, it supports python's logging.config format, but we can also add support to JSON and YAML as they do in this uvicorn's function if you think it is useful. |
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.
That looks fantastic @pablobgar! I think it makes a lot of sense to apply them globally. Thanks a lot for pushing this one upstream! 🚀
Once the tests are green, we should be good to go.
Alright, it seems like there's a small linter error (an unused import). Once that's resolved, this should good to go ahead @pablobgar 👍
(no need to worry about the docs error BTW - that was due to an outdated dep and should be fixed already in master) |
Hey @pablobgar , It looks like the linter has failed again. If you want to run this locally, it should be possible to use the |
Alright, it seems to have worked now! I had some troubles with Optional[str] type and the linter... 😅 What are the next steps @adriangonz? |
Nice one @pablobgar! Thanks a lot for being patient with the linter! Alright, this one should be good to go now 🚀 |
Hi @adriangonz !!! Good to see this feature merged!!! When is a release coming out with these changes? |
We're currently working towards the https://github.com/SeldonIO/MLServer/projects/2?query=is%3Aopen+sort%3Aupdated-desc |
Closes #530
add support to uvicorn logging setting: