osbuild-composer: activate deployment-channel reporting for splunk

followup of PR #4285
This commit is contained in:
Florian Schüller 2024-08-12 13:22:48 +02:00 committed by Florian Schüller
parent 8cfba81b2c
commit 09c5f5e374

View file

@ -84,6 +84,10 @@ func main() {
logrus.Fatalf("Error printing configuration: %v", err)
}
if config.DeploymentChannel != "" {
logrus.AddHook(&common.EnvironmentHook{Channel: config.DeploymentChannel})
}
if config.SplunkHost != "" {
hook, err := slogger.NewSplunkHook(context.Background(), config.SplunkHost, config.SplunkPort, config.SplunkToken, "osbuild-composer")
@ -110,10 +114,6 @@ func main() {
logrus.Warn("GLITCHTIP_DSN not configured, skipping initializing Sentry/Glitchtip")
}
if config.DeploymentChannel != "" {
logrus.AddHook(&common.EnvironmentHook{Channel: config.DeploymentChannel})
}
stateDir, ok := os.LookupEnv("STATE_DIRECTORY")
if !ok {
logrus.Fatal("STATE_DIRECTORY is not set. Is the service file missing StateDirectory=?")