Skip to content

Commit

Permalink
logging env variable docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Oct 23, 2020
1 parent 72e9021 commit 22f753a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions website/docs/commands/environment-variables.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 5 additions & 1 deletion website/docs/internals/debugging.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 22f753a

Please sign in to comment.