To capture a trace log, set the environment variable
TRACE. Refer to the steps below for more details in a specific Terraform product:
If using Terraform Cloud or Terraform Enterprise with Remote Execution, perform these steps in your Workspace:
- Navigate to Settings > General, and set the User Interface setting to "Console UI"
- Navigate to Variables > Workspace Variables, and add an "Environment variable" with
TF_LOGas key and
- Start a new run
- (Optional) Download the streamed log for further examination in your preferred code editor. You can find the download button towards the top of the failed run.
TIP: Changing the extension of the log file from
.log will enable colored syntax highlighting for most code editors — which can make it easier to read.
Unix/Linux & macOS Operating Systems
In your Linux/macOS terminal type this, making sure you capture both stderr and stdout:
export TF_LOG=TRACE terraform apply -no-color 2>&1 | tee apply.log
Windows Operating Systems
In your PowerShell terminal, use this example:
$Env:TF_LOG = "TRACE" terraform apply -no-color 2>&1 | Tee-Object -FilePath apply.log
Once the issue is resolved, unset the
TF_LOG environment variable to disable the enhanced logging.