diff --git a/config/config.go b/config/config.go index 7aa69eab4..5d72080f8 100644 --- a/config/config.go +++ b/config/config.go @@ -517,6 +517,7 @@ func (c *Config) Finalize() { c.LogLevel = stringFromEnv([]string{ "CT_LOG", "CONSUL_TEMPLATE_LOG", + "CONSUL_TEMPLATE_LOG_LEVEL", }, DefaultLogLevel) } diff --git a/config/config_test.go b/config/config_test.go index ef8fd877f..ac8464564 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -2056,7 +2056,7 @@ func TestDefaultConfig(t *testing.T) { false, }, { - "CONSUL_TEMPLATE_LOG", + "CONSUL_TEMPLATE_LOG_LEVEL", "DEBUG", &Config{ LogLevel: String("DEBUG"), diff --git a/docs/observability.md b/docs/observability.md index fc994bc26..5d2e90585 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -9,6 +9,8 @@ Consul Template, use the `-log-level` flag: $ consul-template -log-level info ... ``` +Or set it via the `CONSUL_TEMPLATE_LOG_LEVEL` environment variable. + ```text [INFO] (cli) received redis from Watcher [INFO] (cli) invoking Runner