TERRAFORM-ASSOCIATE-003 practice question 10 of 30

[Read, Generate, and Modify Configurations] Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.

Full set: 226 questions
Answer options
A: True
B: False
Correct Answer:
FALSE
Explanation

Setting the TFLOG environment variable to DEBUG does enable detailed logging for Terraform's core and providers. However, by default, this log output is sent to the stderr (standard error) stream, not the stdout (standard output) stream. This separation ensures that diagnostic and debug information does not interfere with the primary, often machine-readable, output of commands like terraform plan or terraform show, which are directed to stdout.

Why Incorrect

The statement "True" is incorrect because it misidentifies the standard stream used for logging. Terraform explicitly directs log output to stderr to keep it separate from the command's primary result on stdout.

References

1. HashiCorp Terraform Documentation

"Debugging Terraform": "To enable logging

set the TFLOG environment variable to one of the log levels (TRACE

DEBUG

INFO

WARN

ERROR) to display logs. ... By default

the log is sent to stderr."

Source: HashiCorp

Terraform CLI Documentation

"Debugging Terraform". Retrieved from https://developer.hashicorp.com/terraform/cli/commands/debug

2. HashiCorp Terraform Documentation

"Environment Variables": Under the TFLOG section

the documentation confirms the behavior: "By default

the log is sent to stderr. To send the log to a file

set the TFLOGPATH environment variable."

Source: HashiCorp

Terraform CLI Documentation

"Environment Variables". Retrieved from https://developer.hashicorp.com/terraform/cli/config/environment-variables#tflog

Scroll to Top