TA-002-P · Question #161
Ric wants to enable detail logging and he wants highest verbosity of logs. Which of the following environment variable settings is correct option for him to select.
The correct answer is C. Set TF_LOG = TRACE. The TF_LOG environment variable controls Terraform log verbosity, and TRACE is the highest level, capturing all internal operations and API calls.
Question
Ric wants to enable detail logging and he wants highest verbosity of logs. Which of the following environment variable settings is correct option for him to select.
Options
- ASet TF_LOG = DEBUG
- BSet VAR_TF = TRACE
- CSet TF_LOG = TRACE
- DSet VAR_TF_LOG = TRACE
How the community answered
(60 responses)- A2% (1)
- B2% (1)
- C92% (55)
- D5% (3)
Why each option
The TF_LOG environment variable controls Terraform log verbosity, and TRACE is the highest level, capturing all internal operations and API calls.
TF_LOG=DEBUG provides detailed logging but sits one level below TRACE in verbosity, so it omits some lower-level trace information that Ric requires.
VAR_TF is not a recognized Terraform environment variable - Terraform only reads TF_LOG for log level control, so this setting would have no effect.
Setting TF_LOG=TRACE enables the most granular logging output available in Terraform, including provider API requests, response details, and internal processing steps. TRACE is at the top of the verbosity hierarchy - TRACE, DEBUG, INFO, WARN, ERROR - making it the correct choice for maximum detail.
VAR_TF_LOG is not a valid Terraform environment variable - the correct variable is TF_LOG, and any other naming convention is ignored by Terraform.
Concept tested: Terraform TF_LOG environment variable and verbosity levels
Source: https://developer.hashicorp.com/terraform/internals/debugging
Topics
Community Discussion
No community discussion yet for this question.