fix: moves unsupported feature logging (#42380)

closes: #42334

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins
2025-09-05 13:21:20 -04:00
committed by GitHub
parent 05c7c625d3
commit 0897560513
3 changed files with 8 additions and 6 deletions

View File

@@ -342,8 +342,7 @@ public class Profile {
verifyConfig(features);
CURRENT = new Profile(profile, features);
return CURRENT;
return init(profile, features);
}
private static boolean isEnabledByDefault(ProfileName profile, Feature f) {
@@ -426,8 +425,6 @@ public class Profile {
private Profile(ProfileName profileName, Map<Feature, Boolean> features) {
this.profileName = profileName;
this.features = Collections.unmodifiableMap(features);
logUnsupportedFeatures();
}
public static Profile getInstance() {
@@ -507,7 +504,7 @@ public class Profile {
}
}
private void logUnsupportedFeatures() {
public void logUnsupportedFeatures() {
logUnsupportedFeatures(Feature.Type.PREVIEW, getPreviewFeatures(), Logger.Level.INFO);
logUnsupportedFeatures(Feature.Type.EXPERIMENTAL, getExperimentalFeatures(), Logger.Level.WARN);
logUnsupportedFeatures(Feature.Type.DEPRECATED, getDeprecatedFeatures(), Logger.Level.WARN);

View File

@@ -251,6 +251,10 @@ class KeycloakProcessor {
void configureProfile(KeycloakRecorder recorder) {
Profile profile = getCurrentOrCreateFeatureProfile();
if (!Environment.isRebuildCheck()) {
profile.logUnsupportedFeatures();
}
// record the features so that they are not calculated again at runtime
recorder.configureProfile(profile.getName(), profile.getFeatures());
}

View File

@@ -18,6 +18,7 @@ package org.keycloak.services.resources;
import org.jboss.logging.Logger;
import org.keycloak.Config;
import org.keycloak.common.Profile;
import org.keycloak.common.crypto.CryptoIntegration;
import org.keycloak.config.ConfigProviderFactory;
import org.keycloak.exportimport.ExportImportConfig;
@@ -58,7 +59,7 @@ public abstract class KeycloakApplication extends Application {
try {
logger.debugv("PlatformProvider: {0}", platform.getClass().getName());
Profile.getInstance().logUnsupportedFeatures();
loadConfig();
platform.onStartup(this::startup);