-
Notifications
You must be signed in to change notification settings - Fork 910
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
Improve logging setup in Kedro #1461
Comments
For reference, some PRs where I tried to fix some of these things before. I wrote my findings up in the PRs at the time, so I'll re-read these to figure out better what we should do here:
|
In general, I am fine with most of the item with some comments for these 2 items.
I like that Kedro is getting lean but I am not sure if I like the idea that the user needs to put the file back to the corresponding location in order to customize it (Although for But it is the same thing for Is this a workaround to maintain backward compatibility or do we prefer users to customize with this approach? or we should gradually move things to
Personally, I like the RotatingFile handler, and IMO it's something that people are not using enough. It could be a life-saver when I am running a lot of experiments (especially without a proper experiment tracking tool). Searching in a single file is very handy even when I have a full experiment tracking setup. Are we removing this because we no longer think this is a good default? |
Thanks for the comments @noklam!
This is a very fair point, and I'm also not sure about the removal of cli.py and hooks.py for the same reasons (like you say, logging.yml seems less important though). It's a balance between:
If we don't supply some template (even blank file with comments) logging.yml or cli.py then we need to make it very clear in the documentation that a user can customise their project this way and make it easy for them to copy and paste an example file to do so. Currently we don't emphasise this enough I think. Another way to achieve this is to keep the default template lean and create a more advanced starter that includes hooks, customised cli.py, etc. settings.py is the new way to customise things in kedro, but not everything belongs in there. e.g. I don't think logging configuration would go there because it's run time configuration:
Definitely understand this and I also like the file-based logging. I think the problems are:
Again, if we do remove this then I think we need to make it very clear in documentation how a user can create a logging.yml that will do file-based logging. Edit: I think we should get some user opinions on this and there's now a ticket for it: #1472 |
For those not already familiar with it, here's how the logging setup in kedro currently works:
The above process will not change in any of the issues mentioned here. It's just that users will by default no longer need to (but still can) provide a project-side logging.yml file. This will make steps 3 and 4 above disappear for anyone who hasn't setup custom logging by providing a project-side logging.yml file, since the framework-side logging config will be loaded and not altered. All logging in kedro should come from a named logger like this:
The name is what determines which loggers to use (as set in the This actually reminds me of two small issues I should create:
|
The outcome of #1472, which showed that people do use the log files, unfortunately makes some of the simplification that was planned here difficult:
So the plan in #1469 changes as follows:
One advantage of this approach is that it is quite minimal compared to how things currently stand. Hence future changes that could simplify the project template here are still possible, e.g. to direct logs to project root info.log/errors.log instead of the logs folder and remove the logs directory. |
Rough notes to be written up into a new issue in due course...
|
Milestone completed and outstanding issues moved to |
Currently Kedro has some issues with the logging setup, which can cause some problems from minor annoyances to failures to run a Kedro project in certain environments. Here is a small list of the problems our current logging setup causes:
kedro.*
in many placesroot
log level is set toINFO
instead ofWARNING
on all official startersKedroSession
logs useless things atINFO
level, like e.g. that the default session store doesn’t have aread()
method andgit describe
failures…kedro catalog list
it should only show the output so it can be machine readable, but now there's lots ofDEBUG
level worthy outputinfo.log
files everywhere for unknown reasons (easiest to notice is when runing a notebook innotebooks/
)In order to address those issues, we need to work on the following:
logging.yml
is optional and tidy logging config #1469Remove file handlers, special casekedro.framework.cli.hooks.manager
handler and add documentation on how to setup logging with them (only if User research to see if we should remove the file-based logging handlers #1472 shows we should remove them)spaceflights
log level toINFO
on framework-side rather than project. Like point 2 of Ensurelogging.yml
is optional and tidy logging config #1469. Needs to usePACKAGE_NAME
?KedroCliError
message is). Otherwise there's no way you will seeDEBUG
level messages emitted by logging calls beforesession._setup_logging
is called, even if you alter your project logging.yml to showDEBUG
level messages. e.g. https://hydra.cc/docs/tutorials/basic/running_your_app/logging/rich
into Kedro natively #1464rich
traceback and REPL handling more configurable #1728 - should rich stuff be moved to hooks anyway? See also my thoughts on spark hooksThe text was updated successfully, but these errors were encountered: