Support whitelisting log lines via regular expressions #25086
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.
This PR makes it possible to whitelist log lines, matching regular expressions, defined in environment variables with a
TF_LOG_PATTERN_
prefix.Lines matching these patterns will be logged regardless of the defined log level in
TF_LOG
.Example:
The following environment variable would whitelist log lines, which are logged by the helm terraform provider
\[\w+\] plugin.terraform-provider-helm
:TF_LOG_PATTERN_HELM_PLUGIN=\[\w+\] plugin.terraform-provider-helm
This features helps with debugging plugins as you can easily define a pattern, which matches the log lines of you own plugin. A related issue does already exist: hashicorp/terraform-plugin-sdk#88
The feature can also be helpful in ci/cd pipelines if you are interested in debug log lines, which match a certain pattern.