From 0cd5115904a8841952c4773687c8b7b34c87e8a7 Mon Sep 17 00:00:00 2001 From: Florian Schwarz Date: Wed, 11 Dec 2024 16:32:26 +0100 Subject: [PATCH] Add logging for service usage --- server/src/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/main.go b/server/src/main.go index d7fabbb7a3..aa1f060ea6 100644 --- a/server/src/main.go +++ b/server/src/main.go @@ -267,6 +267,7 @@ func run(c *cli.Context) error { var rt *realtime.Broker if c.String("redis-address") != "" { + logger.Get().Infof("Connecting to redis at %v", c.String("redis-address")) rt, err = realtime.NewRedis(realtime.RedisServer{ Addr: c.String("redis-address"), Username: c.String("redis-username"), @@ -276,6 +277,7 @@ func run(c *cli.Context) error { logger.Get().Fatalf("failed to connect to redis message queue: %v", err) } } else { + logger.Get().Infof("Connecting to nats at %v", c.String("nats")) rt, err = realtime.NewNats(c.String("nats")) if err != nil { logger.Get().Fatalf("failed to connect to nats message queue: %v", err) @@ -296,6 +298,7 @@ func run(c *cli.Context) error { providersMap := make(map[string]auth.AuthProviderConfiguration) if c.String("auth-google-client-id") != "" && c.String("auth-google-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using google authentication") providersMap[(string)(types.AccountTypeGoogle)] = auth.AuthProviderConfiguration{ ClientId: c.String("auth-google-client-id"), ClientSecret: c.String("auth-google-client-secret"), @@ -303,6 +306,7 @@ func run(c *cli.Context) error { } } if c.String("auth-github-client-id") != "" && c.String("auth-github-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using github authentication") providersMap[(string)(types.AccountTypeGitHub)] = auth.AuthProviderConfiguration{ ClientId: c.String("auth-github-client-id"), ClientSecret: c.String("auth-github-client-secret"), @@ -310,6 +314,7 @@ func run(c *cli.Context) error { } } if c.String("auth-microsoft-client-id") != "" && c.String("auth-microsoft-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using microsoft authentication") providersMap[(string)(types.AccountTypeMicrosoft)] = auth.AuthProviderConfiguration{ ClientId: c.String("auth-microsoft-client-id"), ClientSecret: c.String("auth-microsoft-client-secret"), @@ -317,6 +322,7 @@ func run(c *cli.Context) error { } } if c.String("auth-azure-ad-tenant-id") != "" && c.String("auth-azure-ad-client-id") != "" && c.String("auth-azure-ad-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using azure authentication") providersMap[(string)(types.AccountTypeAzureAd)] = auth.AuthProviderConfiguration{ TenantId: c.String("auth-azure-ad-tenant-id"), ClientId: c.String("auth-azure-ad-client-id"), @@ -325,6 +331,7 @@ func run(c *cli.Context) error { } } if c.String("auth-apple-client-id") != "" && c.String("auth-apple-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using apple authentication.") providersMap[(string)(types.AccountTypeApple)] = auth.AuthProviderConfiguration{ ClientId: c.String("auth-apple-client-id"), ClientSecret: c.String("auth-apple-client-secret"), @@ -332,6 +339,7 @@ func run(c *cli.Context) error { } } if c.String("auth-oidc-discovery-url") != "" && c.String("auth-oidc-client-id") != "" && c.String("auth-oidc-client-secret") != "" && c.String("auth-callback-host") != "" { + logger.Get().Info("Using oicd authentication.") providersMap[(string)(types.AccountTypeOIDC)] = auth.AuthProviderConfiguration{ ClientId: c.String("auth-oidc-client-id"), ClientSecret: c.String("auth-oidc-client-secret"),