-
Notifications
You must be signed in to change notification settings - Fork 920
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
Make logging.yml read by default #3831
Conversation
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
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.
Tested this locally and it works.
Wondering if we could add some logging message like
WARNING Using `conf/logging.yml` as logging configuration, you can change it by setting the KEDRO_LOGGING_CONFIG variable accordingly
to minimise surprises and clarify what's happening. What do you folks think?
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
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.
Works:
❯ kedro run
Using `conf/logging.yml` as logging configuration. You can change this by setting the KEDRO_LOGGING_CONFIG environment variable accordingly.
I'll let others comment on the implementation. Leaving just one comment.
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
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.
Manual tested, works well! 👍🏾
Not sure why the windows test are getting a permission error. Anyone have any ideas? |
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Description
Related to: #3801
Implement a fix to make sure the default file is read. KEDRO_LOGGING_CONFIG will take priority when it is provided.
Development notes
conf/logging.yml
ifKEDRO_LOGGING_CONFIG
isn't set.conf/logging.yml
does not exist, it falls back todefault_logging.yml
.CONF_SOURCE
Investigated the possibility of adding custom
CONF_SOURCE
support during the logging setup, allowing thelogging.yml
to be dynamically set. Below are the results of this investigation:Code changes:
Explanation:
The above code attempted to fetch the
CONF_SOURCE
setting from the Kedro settings and use this setting to find the path of the logging config file, allowing the logging setup to change automatically depending on where the user specifies.Issues:
During the implementation I ran into several problems mostly due to timings:
The dynamic fetching of settings led to circular imports because the logging module depended on settings, which in turn depended on other things that required logging. This dependency cycle caused runtime errors preventing the project from starting.
This approach also complicated the creation of the project. It was quite challengin to initialise logging before all configurations are loaded without causing import loops.
So for now the current approach of using the happy path for logging will only remain. For the users that need more dynamic logging they will have to manually configure logging. I've enhanced the documentation to outline this.
Developer Certificate of Origin
We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a
Signed-off-by
line in the commit message. See our wiki for guidance.If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
Checklist
RELEASE.md
file