diff --git a/internal/session/provider_config.go b/internal/session/provider_config.go index e7ea52283..70ec4621a 100644 --- a/internal/session/provider_config.go +++ b/internal/session/provider_config.go @@ -11,6 +11,7 @@ import ( "github.com/valyala/fasthttp" "github.com/authelia/authelia/v4/internal/configuration/schema" + "github.com/authelia/authelia/v4/internal/logging" "github.com/authelia/authelia/v4/internal/utils" ) @@ -80,6 +81,7 @@ func NewProviderConfig(configuration schema.SessionConfiguration, certPool *x509 providerName = "redis-sentinel" redisSentinelConfig = &redis.FailoverConfig{ + Logger: &redisLogger{logger: logging.Logger()}, MasterName: configuration.Redis.HighAvailability.SentinelName, SentinelAddrs: addrs, SentinelPassword: configuration.Redis.HighAvailability.SentinelPassword, @@ -108,6 +110,7 @@ func NewProviderConfig(configuration schema.SessionConfiguration, certPool *x509 } redisConfig = &redis.Config{ + Logger: newRedisLogger(), Network: network, Addr: addr, Username: configuration.Redis.Username, diff --git a/internal/session/types.go b/internal/session/types.go index 877975136..0dc6ed167 100644 --- a/internal/session/types.go +++ b/internal/session/types.go @@ -1,14 +1,17 @@ package session import ( + "context" "time" "github.com/fasthttp/session/v2" "github.com/fasthttp/session/v2/providers/redis" + "github.com/sirupsen/logrus" "github.com/tstranex/u2f" "github.com/authelia/authelia/v4/internal/authentication" "github.com/authelia/authelia/v4/internal/authorization" + "github.com/authelia/authelia/v4/internal/logging" ) // ProviderConfig is the configuration used to create the session provider. @@ -75,3 +78,15 @@ type OIDCWorkflowSession struct { RequiredAuthorizationLevel authorization.Level CreatedTimestamp int64 } + +func newRedisLogger() *redisLogger { + return &redisLogger{logger: logging.Logger()} +} + +type redisLogger struct { + logger *logrus.Logger +} + +func (l *redisLogger) Printf(_ context.Context, format string, v ...interface{}) { + l.logger.Tracef(format, v...) +}