Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(loki): panic on missing config #720

Merged
merged 3 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/loki/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ COPY loki /bin/loki
COPY loki-local-config.yaml /etc/loki/local-config.yaml
EXPOSE 80
ENTRYPOINT [ "/bin/loki" ]
CMD ["-config.file=/etc/loki/local-config.yaml"]
1 change: 1 addition & 0 deletions cmd/loki/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ RUN apk add --no-cache libc6-compat
# Pass flags to the program you are debugging using --, for example:`
# dlv exec ./hello -- server --config conf/config.toml`
ENTRYPOINT ["/usr/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/bin/loki-debug", "--"]
CMD ["-config.file=/etc/loki/local-config.yaml"]
8 changes: 3 additions & 5 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ func main() {

util.InitLogger(&cfg.Server)

if configFile != "" {
if err := helpers.LoadConfig(configFile, &cfg); err != nil {
level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err)
os.Exit(1)
}
if err := helpers.LoadConfig(configFile, &cfg); err != nil {
sh0rez marked this conversation as resolved.
Show resolved Hide resolved
level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err)
os.Exit(1)
}

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