AuthN: Make logger less noisy (#76044)

* Change to debug for token needs rotation errors
pull/76056/head
Karl Persson 2 years ago committed by GitHub
parent 6614eb0a6e
commit 81b366e2c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      pkg/services/authn/authnimpl/service.go

@ -226,7 +226,12 @@ func (s *Service) authenticate(ctx context.Context, c authn.Client, r *authn.Req
r.OrgID = orgIDFromRequest(r)
identity, err := c.Authenticate(ctx, r)
if err != nil {
s.log.FromContext(ctx).Warn("Failed to authenticate request", "client", c.Name(), "error", err)
log := s.log.FromContext(ctx).Warn
if errors.Is(err, authn.ErrTokenNeedsRotation) {
log = s.log.FromContext(ctx).Debug
}
log("Failed to authenticate request", "client", c.Name(), "error", err)
return nil, err
}

Loading…
Cancel
Save