Skip to content

Commit b2744fc

Browse files
committed
fix(loki): pass missing config error to user
Missing config errors are handled at the library level. Our own check mitigated this and causes loki to SEGFAULT later on
1 parent 1c95a5b commit b2744fc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/loki/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ func main() {
4343

4444
util.InitLogger(&cfg.Server)
4545

46-
if configFile != "" {
47-
if err := helpers.LoadConfig(configFile, &cfg); err != nil {
48-
level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err)
49-
os.Exit(1)
50-
}
46+
if err := helpers.LoadConfig(configFile, &cfg); err != nil {
47+
level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err)
48+
os.Exit(1)
5149
}
5250

5351
// Re-init the logger which will now honor a different log level set in cfg.Server

0 commit comments

Comments
 (0)