From eb2d4434c85399f38752042015c3a4536e17ae40 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 23 Oct 2020 08:52:48 -0400 Subject: [PATCH] logging env variable docs --- website/docs/commands/environment-variables.html.md | 8 ++++---- website/docs/internals/debugging.html.md | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/website/docs/commands/environment-variables.html.md b/website/docs/commands/environment-variables.html.md index e07848024..ed003332e 100644 --- a/website/docs/commands/environment-variables.html.md +++ b/website/docs/commands/environment-variables.html.md @@ -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). diff --git a/website/docs/internals/debugging.html.md b/website/docs/internals/debugging.html.md index 01c964741..6d41f13d3 100644 --- a/website/docs/internals/debugging.html.md +++ b/website/docs/internals/debugging.html.md @@ -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.