hashicorp / hashicorp/terraform-plugin-log
Allow `JSON` for `TF_LOG_PROVIDER_{provider}` configuration
- Dominant language
- Go
- Stars
- 23
- Forks
- 11
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 1
Description
### terraform-plugin-log version
```
v0.7.0
```
### Relevant provider source code
n/a
### Terraform Configuration Files
n/a
### Expected Behavior
From the [documentation](https://developer.hashicorp.com/terraform/plugin/log/managing) I would expect that e.g. setting `TF_LOG_PROVIDER_{provider}=JSON` would result in logs in JSON with `TRACE` log level.
### Actual Behavior
Using `TF_LOG_PROVIDER_{provider}=JSON` doesn't configure logging at all.
Setting `TF_LOG=JSON` works as expected though. And I cannot combine them since `TF_LOG` overrides the others.
### Steps to Reproduce
Just set `TF_LOG_PROVIDER_{provider}=JSON` for any *provider* when running Terraform.
I'm using it when running provider acceptance tests.
### References
Contributor guide
Research direction
Start by tracing how TF_LOG and TF_LOG_PROVIDER_{provider} environment variables are parsed, then reproduce the issue with a provider-specific value of JSON. Done means the provider-specific setting enables TRACE-level JSON logging without being ignored or requiring the global TF_LOG variable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100