-
Notifications
You must be signed in to change notification settings - Fork 926
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
Extended docs with logging customisation at runtime #3968
Conversation
Signed-off-by: Elena Khaustova <[email protected]>
Signed-off-by: Elena Khaustova <[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.
Some stylistic soft suggestions - I also wonder if it's worth listing out the other other class paths we may want to tell the user they can quieten 🤔
docs/source/logging/index.md
Outdated
@@ -42,6 +42,17 @@ After setting the environment variable, any subsequent Kedro commands use the lo | |||
If the `KEDRO_LOGGING_CONFIG` environment variable is not set, Kedro will use the [default logging configuration](https://github.com/kedro-org/kedro/blob/main/kedro/framework/project/default_logging.yml). | |||
``` | |||
|
|||
One can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml`. |
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.
One can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml`. | |
### Change the verbosity of specific parts of Kedro | |
One can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml`. |
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.
"You can" instead of "One can", maybe? Most of the docs are in second person I think
docs/source/logging/index.md
Outdated
@@ -42,6 +42,17 @@ After setting the environment variable, any subsequent Kedro commands use the lo | |||
If the `KEDRO_LOGGING_CONFIG` environment variable is not set, Kedro will use the [default logging configuration](https://github.com/kedro-org/kedro/blob/main/kedro/framework/project/default_logging.yml). | |||
``` | |||
|
|||
One can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml`. | |||
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component, so the setting is only applied to the `kedro.io.data_catalog` logger and for the rest of the components the default settings provided via `logging.yml` are remained unchanged. |
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.
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component, so the setting is only applied to the `kedro.io.data_catalog` logger and for the rest of the components the default settings provided via `logging.yml` are remained unchanged. | |
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component logger specifically, the logging for the rest of the components will remain unchanged. |
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.
Apart from the vale
suggestions and @datajoely's comment, LGTM!
Signed-off-by: Elena Khaustova <[email protected]>
I have applied the suggestions, thank you! As for the other class paths, do you have any in mind that are worth adding or about which we have complaints? Overall, adding another path should be straightforward now even with this example. |
docs/source/logging/index.md
Outdated
@@ -42,6 +42,17 @@ After setting the environment variable, any subsequent Kedro commands use the lo | |||
If the `KEDRO_LOGGING_CONFIG` environment variable is not set, Kedro will use the [default logging configuration](https://github.com/kedro-org/kedro/blob/main/kedro/framework/project/default_logging.yml). | |||
``` | |||
|
|||
One can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml`. |
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.
"You can" instead of "One can", maybe? Most of the docs are in second person I think
docs/source/logging/index.md
Outdated
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component logger specifically, the logging for the rest of the components will remain unchanged. | ||
The same can be done for higher/lower-level components without affecting the top-level. | ||
|
||
```python |
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.
This would go in the settings.py
, right? Worth mentioning where to put this code.
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's a good catch, I've added a clarification that this is relevant for the notebook environment. We cannot make it in settings.py
since logging configuration from logging.yml
is applied after settings.py
configuration
kedro/kedro/framework/project/__init__.py
Line 273 in 413dbca
def configure_project(package_name: str) -> None: |
logging.yml
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.
So, the alternative is to customise logging.yml
described in the neighbouring section.
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.
Ah I see, makes sense!
Signed-off-by: Elena Khaustova <[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.
Some small suggestions, but otherwise looks good to me! 👍 Great way to resolve the original issue.
docs/source/logging/index.md
Outdated
@@ -42,6 +42,21 @@ After setting the environment variable, any subsequent Kedro commands use the lo | |||
If the `KEDRO_LOGGING_CONFIG` environment variable is not set, Kedro will use the [default logging configuration](https://github.com/kedro-org/kedro/blob/main/kedro/framework/project/default_logging.yml). | |||
``` | |||
|
|||
### Change the verbosity of specific parts of Kedro | |||
|
|||
You can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml` when using jupyter notebook. |
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.
You can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml` when using jupyter notebook. | |
You can also customise logging at runtime and redefine the logging configuration provided in the `logging.yml` when using jupyter notebook. |
docs/source/logging/index.md
Outdated
### Change the verbosity of specific parts of Kedro | ||
|
||
You can also customise logging at the runtime and redefine the logging configuration provided in the `logging.yml` when using jupyter notebook. | ||
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component logger specifically, the logging for the rest of the components will remain unchanged. |
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.
In the example below we change a logging level to `WARNING` for the `kedro.io.data_catalog` component logger specifically, the logging for the rest of the components will remain unchanged. | |
The example below demonstrates how you can change the logging level from `INFO` to `WARNING` for the `kedro.io.data_catalog` component logger specifically, the logging for the rest of the components will remain unchanged. |
Signed-off-by: Elena Khaustova <[email protected]>
Description
Solves #3918
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