-
Notifications
You must be signed in to change notification settings - Fork 930
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
default logging configuration doesn't log other packages than kedro #1732
Comments
This is a quite annoying issue I am facing too : All tests of this PR on The fix in |
Hello @Debbby57 and @Galileo-Galilei, and thanks as ever for raising the issue here! I'm responsible for this change so let me try to explain a bit. This was indeed a change made in 0.18.1:
So this change was indeed intentional, and the reason this was designated a bug fix/minor change rather than a breaking change was because (a) the previous behaviour on Kedro was arguably incorrect and (b) I didn't anticipate this change affecting anyone (indeed you're the first people to even notice it). In hindsight probably this should have been noted under "Minor breaking changes to the API" instead though. So sorry about this and the awkwardness it has caused you! First note that the default logging level in Python is set to
i.e. we changed the root logging level to Why did I not like this? Because it's heavy-handed and disruptive since it alters the behaviour of the So in 0.18.1 this was changed to:
i.e. we leave the Note this actually immediately causes a new problem for us, since any Unfortunately packages outside our responsibility also include plugins such as kedro-mlflow. I hadn't really considered this specifically before and do see why it would be a problem, sorry! So what can be done about this?
Let me know what you think! My feeling is that the right solution here would be 4 for plugins like kedro-mlflow, and 1 or 2 for other packages like paramiko. I am still willing to be convinced that option 5 or 6 is the right solution here, but currently they don't feel right to me. Maybe there's another solution I didn't think of, so if you have any ideas then please do say. I hope this helps to explain the change and the balance of factors that need to be considered here anyway. |
thank you for your reply.
|
Just to clarify, if option 4 works then it should be possible for all packages, not just kedro-plugins. Indeed I think that any packages that work outside kedro and wish to emit Let me check this actually, since the more I think about it the more this feels like it would be the right approach, and if kedro doesn't currently work with external packages like this then it's a problem. We shouldn't be losing log messages for packages which do explicitly setting their levels to @Debbby57 just to understand a bit better, please can you explain exactly what are the packages for which you want |
I've just done some testing of this and believe that option 4 should indeed work. i.e. if you have a package that uses a logger set to level This seems like the correct solution because each package then has responsibility to choose the appropriate log level for itself, and such packages will work as expected both inside and outside kedro. In practice, what does this mean? For package authors (package could be kedro plugin, e.g.
|
I'm going to close this issue because I think there's nothing that needs to change on the Kedro side, but please do tag me in a comment and say if you disagree and I'll be happy to reopen! |
Hi @AntonyMilneQB, thank you for the reply. What you say makes sense, but it would be nice if kedro plugins were set to "the same logging level" as kedro (e.g. INFO by default), but there are a few edge cases to deal with (e.g. if a user specifically specifies two different logging level in the Hardcoding the logging INFO level inside the package is not user friendly, but I guess I can use |
HI @Galileo-Galilei, it would indeed make sense to set kedro plugins to the same logging level as kedro (so Alternatively we could encourage plugins to log to With that said, I don't quite understand the problem with specifying the logging level on the package side:
This feels like overkill indeed, but maybe I'm missing something. What is wrong with setting |
I don't know either, but since they are loaded through an entrypoint, there is likely a way to get the names of plugins dynamically (e.g. "any package with given entrypoints"). It does not seems trivial, and likely not a high priority.
I really like the idea, but does it require having
Not sure I am not very familiar with
# logging.yml
loggers:
kedro_mlflow:
level: WARNING # <- anything other than INFO?
|
Hi @Galileo-Galilei, I finally got a chance to try out some code here, did a I think your solution setting the logging level in the package root Are you happy with this solution? It feels correct to me 🙂 |
Thank you very much for taking time to test it! |
Perfect, thank you for confirming! I think we're all good here then and I will close the issue. |
Description
since the 0.18.2 release, I lost the logs for the other packages than kedro in my projects, if I don't specify them in the logging.yaml
I tested with multiple packages like custom kedro plugins like kedro-mlflow (@Galileo-Galilei) and other packages like paramiko.
If I want to have logs for thoses packages I need to update logging.yml
I think it's a bug because for me it's difficult to ask users to add all their packages in the logging.yaml. I think the default behavior we want is to have all logs by default and use logging.yaml to remove logs we don't want.
Context
I need all my logs by default to control the correct behavior of my projects. And if I don't want some of them I remove them
Steps to Reproduce
Expected Result
By default, we should have all logs.
Actual Result
We just have kedro logs.
Your Environment
Include as many relevant details about the environment in which you experienced the bug:
pip show kedro
orkedro -V
): 0.18.2python -V
): 3.9.13Thank you for your help :)
The text was updated successfully, but these errors were encountered: