To capture a trace log, set the environment variable
TRACE. With this set,
TRACE level logging will be captured in the output.
Terraform Cloud and Enterprise
If this run is in Terraform Enterprise (or being run in Terraform Enterprise via the remote backend), then set
TRACE in the environment variables section of the workspace’s Variables page.
Linux, MacOS, UNIX
At the Linux console this method can be used, being sure to capture both stderr and stdout:
export TF_LOG=TRACE terraform apply 2>&1 | tee apply.txt
At a Powershell prompt, use this example:
$Env:TF_LOG = "TRACE" terraform apply 2>&1 | Tee-Object -FilePath apply.txt
Once the issue is resolved, unset the
TF_LOG environment variable to disable the enhanced logging.