Skip to content

Commit

Permalink
Extended docs with logging customisation at runtime (#3968)
Browse files Browse the repository at this point in the history
* Added a note on logging customisation at runtime

Signed-off-by: Elena Khaustova <[email protected]>

* Updated RELEASE.md

Signed-off-by: Elena Khaustova <[email protected]>

* Applied siggesions

Signed-off-by: Elena Khaustova <[email protected]>

* Applied suggestions

Signed-off-by: Elena Khaustova <[email protected]>

* Applied suggested changes

Signed-off-by: Elena Khaustova <[email protected]>

---------

Signed-off-by: Elena Khaustova <[email protected]>
  • Loading branch information
ElenaKhaustova authored Jun 27, 2024
1 parent 413dbca commit a683cd3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

## Documentation changes

Extended documentation with an example of logging customisation at runtime

## Community contributions

# Release 0.19.6
Expand Down
15 changes: 15 additions & 0 deletions docs/source/logging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a683cd3

Please sign in to comment.