logging env variable docs

This commit is contained in:
James Bardin 2020-10-23 08:52:48 -04:00
parent f8893785f0
commit eb2d4434c8
2 changed files with 9 additions and 5 deletions

View File

@ -16,16 +16,16 @@ for debugging.
## TF_LOG
If set to any value, enables detailed logs to appear on stderr which is useful for debugging. For example:
Enables detailed logs to appear on stderr which is useful for debugging. For example:
```shell
export TF_LOG=TRACE
export TF_LOG=trace
```
To disable, either unset it or set it to empty. When unset, logging will default to stderr. For example:
To disable, either unset it, or set it to `off`. For example:
```shell
export TF_LOG=
export TF_LOG=off
```
For more on debugging Terraform, check out the section on [Debugging](/docs/internals/debugging.html).

View File

@ -10,7 +10,11 @@ description: |-
Terraform has detailed logs which can be enabled by setting the `TF_LOG` environment variable to any value. This will cause detailed logs to appear on stderr.
You can set `TF_LOG` to one of the log levels `TRACE`, `DEBUG`, `INFO`, `WARN` or `ERROR` to change the verbosity of the logs. `TRACE` is the most verbose and it is the default if `TF_LOG` is set to something other than a log level name.
You can set `TF_LOG` to one of the log levels `TRACE`, `DEBUG`, `INFO`, `WARN` or `ERROR` to change the verbosity of the logs.
Logging can be enabled separately for terraform itself and the provider plugins
using the `TF_LOG_CORE` or `TF_LOG_PROVIDER` environment variables. These take
the same level arguments as `TF_LOG`, but only activate a subset of the logs.
To persist logged output you can set `TF_LOG_PATH` in order to force the log to always be appended to a specific file when logging is enabled. Note that even when `TF_LOG_PATH` is set, `TF_LOG` must be set in order for any logging to be enabled.