Capture debug logs into a file for later analysis.

Section: Debugging

Write debug log to file

bash
bash
export TF_LOG=DEBUG && export TF_LOG_PATH=terraform-debug.log
Explanation

Capture debug logs into a file for later analysis.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Debugging
Enable TRACE logs
Turn on maximum logging detail for hard-to-diagnose issues.
OpenIn sheetbashsame section
Inspect provider schemas
Dump provider schemas for automation or debugging tools.
OpenIn sheetbashsame section
Use detailed exit codes
Return 0 for no changes, 2 for changes, 1 for errors; useful in CI.
OpenIn sheetbashsame section
Legacy 0.13 upgrade helper
Legacy helper command that updated provider source declarations in Terraform 0.13.
OpenIn sheetbash1 tag match
Inspect module resource
Inspect one resource nested inside a module.
OpenIn sheetbash1 tag match
Detect and record drift
Refresh state from real infrastructure without proposing config changes.
OpenIn sheetbash1 tag match