diff --git a/internal/api/listener.go b/internal/api/listener.go index 27bb92d..953f1d2 100644 --- a/internal/api/listener.go +++ b/internal/api/listener.go @@ -77,6 +77,7 @@ func (l *Listener) Run(ctx context.Context) error { var errServe error if l.config.TLSCertPath != "" && l.config.TLSKeyPath != "" { + l.logger.Info("Using TLS", "component", "listener", "key", l.config.TLSKeyPath, "cert", l.config.TLSCertPath) errServe = server.ListenAndServeTLS(l.config.TLSCertPath, l.config.TLSKeyPath) } else { errServe = server.ListenAndServe() diff --git a/internal/config/config.go b/internal/config/config.go index 0b44a8d..a43106e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,4 +1,4 @@ -// Licensed under "BSD 3-Clause". See LICENSE file. +// SPDX-License-Identifier: BSD-3-Clause package config @@ -83,6 +83,9 @@ func NewConfigFromCLI(cli *CLI) (*Config, error) { if errTLS != nil { return &conf, fmt.Errorf("error loading the TLS configuration %w", errTLS) } + + conf.TLSKeyPath = cli.TLSKeyPath + conf.TLSCertPath = cli.TLSCertPath } conf.IcingaTLSConfig = &tls.Config{ diff --git a/main.go b/main.go index 0cac317..729bc7e 100644 --- a/main.go +++ b/main.go @@ -51,6 +51,7 @@ func main() { // Central logger that we pass to the components logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: config.MapLogLevel(cli.Loglevel)})) + slog.SetDefault(logger) cfg, errConfig := config.NewConfigFromCLI(&cli)