1. HashiCorp Terraform Documentation, "Environment Variables":
TFLOG: "This is a legacy environment variable. To enable detailed logs, set TFLOG to one of the log levels (TRACE, DEBUG, INFO, WARN, ERROR) to display detailed logs for that level and higher. When TFLOG is set, the logs are written to stderr."
TFLOGPATH: "Sets a path to a file that Terraform will use to write detailed logs. If TFLOGPATH is set, TFLOG must also be set. For example, TFLOG=TRACE TFLOGPATH=terraform.log."
Source: HashiCorp, "Terraform CLI - Configuration - Environment Variables", developer.hashicorp.com/terraform/cli/config/environment-variables. Accessed May 2024.
2. HashiCorp Learn, "Debug Terraform" Tutorial:
Section: "Enable Logging": This tutorial explicitly demonstrates the combined use of both variables. It states, "To persist the log to a file, set the TFLOGPATH environment variable to your desired log file. You must set TFLOG for TFLOGPATH to have an effect." This clarifies that TFLOG alone does not configure file-based logging.
Source: HashiCorp Learn, "Debug Terraform", developer.hashicorp.com/terraform/tutorials/debug/debug-terraform. Accessed May 2024.