diff --git a/RELEASE.md b/RELEASE.md index 36fd39ea9f..0fbaa2af58 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -14,6 +14,8 @@ ## Documentation changes +Extended documentation with an example of logging customisation at runtime + ## Community contributions # Release 0.19.6 diff --git a/docs/source/logging/index.md b/docs/source/logging/index.md index b38679a3c7..efab8ccbfe 100644 --- a/docs/source/logging/index.md +++ b/docs/source/logging/index.md @@ -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 runtime and redefine the logging configuration provided in the `logging.yml` when using jupyter notebook. +The example below demonstrates how you can change the logging level from default `INFO` 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. + +Add the following to a cell in your notebook: + +```ipython +import logging + + +logging.getLogger("kedro.io.data_catalog").setLevel(logging.WARNING) +``` + ## Custom `CONF_SOURCE` with logging When you customise the [`CONF_SOURCE`](../configuration/configuration_basics.md#how-to-change-the-configuration-source-folder-at-runtime) setting in your Kedro project, it determines where Kedro looks for configuration files, including the logging configuration file. However, changing `CONF_SOURCE` does not automatically update the path to `logging.yml`. To use a custom location or filename for the logging configuration, you must explicitly set the `KEDRO_LOGGING_CONFIG` environment variable.