terraform debuging - ghdrako/doc_snipets GitHub Wiki

TF_LOG supports any of the following log levels: TRACE, DEBUG, INFO, WARN, or ERROR. By default, the TRACE log level is enabled, which is the recommended one by Terraform because it provides the most detailed logs.

TF_LOG_PATH in the environment variable of Terraform and point it to the respective location where you want to save your log file

export TF_LOG=TRACE
export TF_LOG_PATH=./terraform.log

When Terraform crashes it will save a log file called crash.log, which would have all the debug logs of the session as well as the panic message and backtrace. Pass on these logs to the developer via GitHub's issues page (https://github.com/hashicorp/terraform/issues).