diff --git a/core/src/main/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenService.java b/core/src/main/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenService.java index ec3b5dcdb8..1b44b9ea6e 100644 --- a/core/src/main/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenService.java +++ b/core/src/main/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenService.java @@ -193,7 +193,9 @@ public final class JdbcOneTimeTokenService implements OneTimeTokenService, Dispo List parameters = List.of(new SqlParameterValue(Types.TIMESTAMP, Instant.now())); PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters.toArray()); int deletedCount = this.jdbcOperations.update(DELETE_SESSIONS_BY_EXPIRY_TIME_QUERY, pss); - this.logger.debug("Cleaned up " + deletedCount + " expired tokens"); + if (logger.isDebugEnabled()) { + this.logger.debug("Cleaned up " + deletedCount + " expired tokens"); + } } @Override