我想要输出Terraform的日志
我在文件里找不到怎么办的时候,发现了它在这里。听说可以通过设置环境变量来显示。
export TF_LOG=1
export TF_LOG_PATH='./terraform.log'
Hashicorp的产品有很多是这种形式的。
日志的例子
$ cat terraform.log
2015/02/24 14:57:41 [INFO] Terraform version: 0.3.6
2015/02/24 14:57:41 Detected home directory from env var: /Users/akuwano
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: atlas = /Users/akuwano/homebrew/bin/terraform-provider-atlas
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: aws = /Users/akuwano/homebrew/bin/terraform-provider-aws
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: cloudflare = /Users/akuwano/homebrew/bin/terraform-provider-cloudflare
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: cloudstack = /Users/akuwano/homebrew/bin/terraform-provider-cloudstack
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: consul = /Users/akuwano/homebrew/bin/terraform-provider-consul
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: digitalocean = /Users/akuwano/homebrew/bin/terraform-provider-digitalocean
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: dnsimple = /Users/akuwano/homebrew/bin/terraform-provider-dnsimple
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: google = /Users/akuwano/homebrew/bin/terraform-provider-google
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: heroku = /Users/akuwano/homebrew/bin/terraform-provider-heroku
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: mailgun = /Users/akuwano/homebrew/bin/terraform-provider-mailgun
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: null = /Users/akuwano/homebrew/bin/terraform-provider-null
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: file = /Users/akuwano/homebrew/bin/terraform-provisioner-file
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: local-exec = /Users/akuwano/homebrew/bin/terraform-provisioner-local-exec
2015/02/24 14:57:41 [DEBUG] Discoverd plugin: remote-exec = /Users/akuwano/homebrew/bin/terraform-provisioner-remote-exec
2015/02/24 14:57:41 Detected home directory from env var: /Users/akuwano
(snip)