From f9fa0fac84e96ca5b014a9672a8f09ef822985bc Mon Sep 17 00:00:00 2001 From: Edward Dowling Date: Wed, 23 Oct 2024 15:50:37 +0100 Subject: [PATCH] Swap to using slog in msteams app --- integrations/access/msteams/app.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/integrations/access/msteams/app.go b/integrations/access/msteams/app.go index d70a7726481e..83cb0e9b3b45 100644 --- a/integrations/access/msteams/app.go +++ b/integrations/access/msteams/app.go @@ -49,11 +49,11 @@ const ( type App struct { conf Config - apiClient teleport.Client - bot *Bot - mainJob lib.ServiceJob - watcherJob lib.ServiceJob - pd *pd.CompareAndSwap[PluginData] + apiClient teleport.Client + bot *Bot + mainJob lib.ServiceJob + watcherJob lib.ServiceJob + pd *pd.CompareAndSwap[PluginData] log *slog.Logger accessMonitoringRules *accessmonitoring.RuleHandler @@ -185,10 +185,10 @@ func (a *App) initBot(ctx context.Context) error { "id", teamsApp.ID) if err := a.bot.CheckHealth(ctx); err != nil { - log.WithField("name", teamsApp.DisplayName). - WithField("id", teamsApp.ID). - WithError(err). - Warn("MS Teams healthcheck failed") + + a.log.WarnContext(ctx, "MS Teams healthcheck failed", + "name", teamsApp.DisplayName, + "id", teamsApp.ID) } if !a.conf.Preload { @@ -258,7 +258,6 @@ func (a *App) run(ctx context.Context) error { return trace.Wrap(err, "initializing Access Monitoring Rule cache") } } - log := logger.Get(ctx) a.watcherJob = watcherJob a.watcherJob.SetReady(ok)