Skip to content

Commit

Permalink
fix(loki): honor log level from config file (#657)
Browse files Browse the repository at this point in the history
Because of the logger being initialized before the configuration file is parsed,
the log_level from the config file is ignored.
To solve this, the logger is reinitialized after the file is parsed, as it is
already being done in promtail.
  • Loading branch information
sh0rez authored and cyriltovena committed Jun 10, 2019
1 parent 11ad356 commit 6fac954
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func main() {
}
}

// Re-init the logger which will now honor a different log level set in cfg.Server
util.InitLogger(&cfg.Server)

// Setting the environment variable JAEGER_AGENT_HOST enables tracing
trace := tracing.NewFromEnv(fmt.Sprintf("loki-%s", cfg.Target))
defer func() {
Expand Down

0 comments on commit 6fac954

Please sign in to comment.