From 0000619f67d0f989a097b4691acefa9c0d3ae225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 15 Jul 2025 10:54:47 +0200 Subject: [PATCH] Manager: improve "loading configuration" log message Raise the log level from DEBUG to INFO, as it's quite important to be explicit about which configuration file is loaded. Also ensure that the file path is made absolute, so that it's again more explicit. --- internal/manager/config/config.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/manager/config/config.go b/internal/manager/config/config.go index ae0ea3e8..8c52269c 100644 --- a/internal/manager/config/config.go +++ b/internal/manager/config/config.go @@ -182,7 +182,17 @@ func DefaultConfig(override ...func(c *Conf)) Conf { // loadConf parses the given file and returns its contents as a Conf object. func loadConf(filename string, overrides ...func(c *Conf)) (Conf, error) { - log.Debug().Str("file", filename).Msg("loading configuration") + // Make sure the rest of the logging uses an absolute path, to help + // disambiguate things and simplify debugging. + if !filepath.IsAbs(filename) { + var err error + filename, err = filepath.Abs(filename) + if err != nil { + return Conf{}, fmt.Errorf("making configuration file path absolute: %w", err) + } + } + + log.Info().Str("file", filename).Msg("loading configuration") yamlFile, err := os.ReadFile(filename) if err != nil { var evt *zerolog.Event