terraform logging - ghdrako/doc_snipets GitHub Wiki

Log level

  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR

Set TF_LOG to JSON which will output the log at TRACE level and format as parsable json.

# Powershell
$env:TF_LOG="TRACE"
$env:TF_LOG_PATH="terraform.txt"

#Bash
export TF_LOG="TRACE"
export TF_LOG_PATH="terraform.txt"

#  to have settings permanently in Powershell add above lines to config file
> notepad $PROFILE

# in bash

echo "export TF_LOG=TRACE" >> .bashrc
echo "export TF_LOG_PATH=terraform.txt" >> .bashrc