Skip to content

Commit

Permalink
Move VerifyConfig after PrintConfig and LogConfig (#5149)
Browse files Browse the repository at this point in the history
Move VerifyConfig after PrintConfig and LogConfig so that config can be dumped and the program can exit instead of starting loki.
  • Loading branch information
srstsavage authored Jan 19, 2022
1 parent 6c85cda commit fafa8d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ func main() {
os.Exit(1)
}

if config.VerifyConfig {
level.Info(util_log.Logger).Log("msg", "config is valid")
os.Exit(0)
}

if config.PrintConfig {
err := logutil.PrintConfig(os.Stderr, &config)
if err != nil {
Expand All @@ -72,6 +67,11 @@ func main() {
}
}

if config.VerifyConfig {
level.Info(util_log.Logger).Log("msg", "config is valid")
os.Exit(0)
}

if config.Tracing.Enabled {
// Setting the environment variable JAEGER_AGENT_HOST enables tracing
trace, err := tracing.NewFromEnv(fmt.Sprintf("loki-%s", config.Target))
Expand Down

0 comments on commit fafa8d1

Please sign in to comment.