Rationale for Correct Answer: Terraform logging is controlled via environment variables. TF_LOG sets the verbosity (e.g., DEBUG), and TF_LOG_PATH directs Terraform to write those logs to a specified file path. This is part of Terraform CLI troubleshooting and operational usage.
Analysis of Incorrect Options (Distractors):
B (Update the Terraform CLI configuration file): The CLI config can control some behaviors (credentials helpers, plugin cache, etc.), but log-to-file is specifically handled by TF_LOG_PATH.
C (Add a path argument to the terraform block): The terraform block configures required versions, required providers, and backends—not CLI logging output.
D (Run the terraform output command): terraform output displays output values from state; it has nothing to do with logging.
Key Concept: Terraform debugging and logging via environment variables (TF_LOG, TF_LOG_PATH).
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit