Skip to content

Commit

Permalink
Add _LEVEL as suffix to CONSUL_TEMPLATE_LOG
Browse files Browse the repository at this point in the history
Adapt config_test accordingly and update documentation
  • Loading branch information
sterchelen authored and eikenb committed Jun 22, 2021
1 parent 435a22d commit 71e6e85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ func (c *Config) Finalize() {
c.LogLevel = stringFromEnv([]string{
"CT_LOG",
"CONSUL_TEMPLATE_LOG",
"CONSUL_TEMPLATE_LOG_LEVEL",
}, DefaultLogLevel)
}

Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ func TestDefaultConfig(t *testing.T) {
false,
},
{
"CONSUL_TEMPLATE_LOG",
"CONSUL_TEMPLATE_LOG_LEVEL",
"DEBUG",
&Config{
LogLevel: String("DEBUG"),
Expand Down
2 changes: 2 additions & 0 deletions docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<timestamp> [INFO] (cli) received redis from Watcher
<timestamp> [INFO] (cli) invoking Runner
Expand Down

0 comments on commit 71e6e85

Please sign in to comment.