-
Notifications
You must be signed in to change notification settings - Fork 559
Adding step name to console logs #3486
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
docs/book/how-to/control-logging/disable-step-names-in-logs.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| description: How to disable step names from being displayed in logs. | ||
| --- | ||
|
|
||
| # Disable step names in logs | ||
|
|
||
| By default, ZenML displays the current step name as a prefix in logs during pipeline execution to help you identify which step is currently running. For example: | ||
|
|
||
| ``` | ||
| [data_loader] Loading data from source... | ||
| [data_loader] Data loaded successfully. | ||
| [model_trainer] Training model with parameters... | ||
| ``` | ||
|
|
||
| It's important to note that these step name prefixes are only added to the console output and are not stored in the actual log files that ZenML saves. The stored logs will always be clean without the step name prefixes. | ||
|
|
||
| Disabling step names in logs is particularly useful when you have multiple pipeline steps running simultaneously, as the step prefixes can sometimes make the logs harder to read when steps are interleaved. In such cases, you might prefer clean logs without prefixes. | ||
|
|
||
| If you wish to disable this feature and have logs without step name prefixes, you can do so by setting the following environment variable: | ||
|
|
||
| ```bash | ||
| ZENML_DISABLE_STEP_NAMES_IN_LOGS=true | ||
| ``` | ||
|
|
||
| Note that setting this on the [client environment](../pipeline-development/configure-python-environments/README.md#client-environment-or-the-runner-environment) (e.g. your local machine which runs the pipeline) will only affect locally executed pipelines. If you wish to disable step names in logs for remote pipeline runs, you can set the `ZENML_DISABLE_STEP_NAMES_IN_LOGS` environment variable in your pipeline runs environment as follows: | ||
|
|
||
| ```python | ||
| from zenml import pipeline | ||
| from zenml.config import DockerSettings | ||
|
|
||
| docker_settings = DockerSettings(environment={"ZENML_DISABLE_STEP_NAMES_IN_LOGS": "true"}) | ||
|
|
||
| # Either add it to the decorator | ||
| @pipeline(settings={"docker": docker_settings}) | ||
| def my_pipeline() -> None: | ||
| my_step() | ||
|
|
||
| # Or configure the pipelines options | ||
| my_pipeline = my_pipeline.with_options( | ||
| settings={"docker": docker_settings} | ||
| ) | ||
| ``` | ||
|
|
||
| When this option is enabled, logs will be displayed without step name prefixes, making them cleaner but potentially harder to associate with specific steps in your pipeline. | ||
|
|
||
| <!-- For scarf --> | ||
| <figure><img alt="ZenML Scarf" referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=f0b4f458-0a54-4fcd-aa95-d5ee424815bc" /></figure> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.