nerdexam
HashiCorp

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.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

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)
  • A
    2% (1)
  • B
    2% (1)
  • C
    92% (55)
  • D
    5% (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.

ASet TF_LOG = DEBUG

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.

BSet VAR_TF = TRACE

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.

CSet TF_LOG = TRACECorrect

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.

DSet VAR_TF_LOG = TRACE

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

#Terraform CLI#Logging#Environment variables#Troubleshooting

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice