linux
export TF_LOG=DEBUG
export TF_LOG_PATH=./terraform.log
cmd
set TF_LOG=DEBUG set TF_LOG_PATH=./terraform.log
powershell
$env:TF_LOG = "DEBUG"
$env:TF_LOG_PATH="./terraform.log"
程序中log.* 打印日志就会输出到 terraform.log
参考
https://www.terraform.io/docs/configuration/environment-variables.html
https://releases.hashicorp.com/terraform