nerdexam
HashiCorpHashiCorp

TA-002-P · Question #161

TA-002-P Question #161: Real Exam Question with Answer & Explanation

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

Explanation

The TF_LOG environment variable controls Terraform log verbosity, and TRACE is the highest level, capturing all internal operations and API calls.

Common mistakes.

  • A. 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.
  • B. 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.
  • D. 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

Reference. 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 PracticeBrowse All TA-002-P Questions