mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-26 07:29:58 +00:00
logging and otel
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/exp/slog"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
@@ -15,7 +18,8 @@ type Server struct {
|
||||
storage *OPStorage
|
||||
*op.LegacyServer
|
||||
|
||||
hashAlg crypto.HashAlgorithm
|
||||
fallbackLogger *slog.Logger
|
||||
hashAlg crypto.HashAlgorithm
|
||||
}
|
||||
|
||||
func endpoints(endpointConfig *EndpointConfig) op.Endpoints {
|
||||
@@ -61,6 +65,13 @@ func endpoints(endpointConfig *EndpointConfig) op.Endpoints {
|
||||
return endpoints
|
||||
}
|
||||
|
||||
func (s *Server) getLogger(ctx context.Context) *slog.Logger {
|
||||
if logger, ok := logging.FromContext(ctx); ok {
|
||||
return logger
|
||||
}
|
||||
return s.fallbackLogger
|
||||
}
|
||||
|
||||
func (s *Server) IssuerFromRequest(r *http.Request) string {
|
||||
return s.Provider().IssuerFromRequest(r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user