Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 325

You can configure Terraform to log to a file using the TF_LOG environment variable.

    Correct Answer: B

    The statement that you can configure Terraform to log to a file using the TF_LOG environment variable is false. The TF_LOG environment variable controls the verbosity of log output but does not specify a file destination. To log to a specific file, you need to use the TF_LOG_PATH environment variable in addition to setting TF_LOG.

Discussion
J_boyOption: B

TF_LOG_PATH is used instead https://developer.hashicorp.com/terraform/internals/debugging

kyochanOption: B

You can configure Terraform to log to a file by setting the TF_LOG_PATH environment variable. When this variable is set, Terraform will write its log output to the specified file.

6957dbdOption: A

This is a badly worded question... Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on stderr. To persist logged output you can set TF_LOG_PATH in order to force the log to always be appended to a specific file when logging is enabled. Note that even when TF_LOG_PATH is set, TF_LOG must be set in order for any logging to be enabled. So, TF_LOG_PATH sets the directory itself, but it will not output anything unless TF_LOG is set.