diff --git a/iam-login-service/src/main/java/it/infn/mw/iam/config/IamProperties.java b/iam-login-service/src/main/java/it/infn/mw/iam/config/IamProperties.java index a6793d664..3893e4c4d 100644 --- a/iam-login-service/src/main/java/it/infn/mw/iam/config/IamProperties.java +++ b/iam-login-service/src/main/java/it/infn/mw/iam/config/IamProperties.java @@ -517,6 +517,8 @@ public void setLocation(String location) { private boolean enableScopeAuthz = true; + private boolean showSql = false; + private LocalResources localResources = new LocalResources(); private Logo logo = new Logo(); @@ -615,6 +617,14 @@ public void setEnableScopeAuthz(boolean enableScopeAuthz) { this.enableScopeAuthz = enableScopeAuthz; } + public boolean isShowSql() { + return showSql; + } + + public void setShowSql(boolean showSql) { + this.showSql = showSql; + } + public LoginButtonProperties getLoginButton() { return loginButton; } diff --git a/iam-login-service/src/main/java/it/infn/mw/iam/config/JpaConfig.java b/iam-login-service/src/main/java/it/infn/mw/iam/config/JpaConfig.java index 696b69365..9d8c26a4f 100644 --- a/iam-login-service/src/main/java/it/infn/mw/iam/config/JpaConfig.java +++ b/iam-login-service/src/main/java/it/infn/mw/iam/config/JpaConfig.java @@ -43,10 +43,12 @@ public class JpaConfig extends JpaBaseConfiguration { public static final String ECLIPSELINK_LOGGING_LEVEL = "eclipselink.logging.level"; public static final String ECLIPSELINK_LOGGING_LEVEL_SQL = "eclipselink.logging.level.sql"; + public final IamProperties iamProperties; protected JpaConfig(DataSource dataSource, JpaProperties properties, - ObjectProvider jtaTransactionManager) { + ObjectProvider jtaTransactionManager, IamProperties iamProperties) { super(dataSource, properties, jtaTransactionManager); + this.iamProperties = iamProperties; } @Autowired @@ -68,7 +70,7 @@ protected Map getVendorProperties() { map.put(ECLIPSELINK_LOGGING_LEVEL_SQL, "OFF"); map.put("eclipselink.cache.shared.default", "false"); - if (System.getProperty("iam.show_sql") != null) { + if (iamProperties.isShowSql()) { map.put(ECLIPSELINK_LOGGING_LEVEL, "FINE"); map.put(ECLIPSELINK_LOGGING_LEVEL_SQL, "FINE"); map.put("eclipselink.logging.parameters", "true"); diff --git a/iam-login-service/src/main/resources/application.yml b/iam-login-service/src/main/resources/application.yml index 9fb2907f1..bc7d27d18 100644 --- a/iam-login-service/src/main/resources/application.yml +++ b/iam-login-service/src/main/resources/application.yml @@ -91,11 +91,11 @@ spring: pathmatch: matching-strategy: "ant-path-matcher" iam: - host: ${IAM_HOST:localhost} baseUrl: ${IAM_BASE_URL:http://${iam.host}:8080} issuer: ${IAM_ISSUER:http://${iam.host}:8080} topbarTitle: ${IAM_TOPBAR_TITLE:INDIGO IAM for ${iam.organisation.name}} + showSql: ${IAM_DATABASE_SHOW_SQL:false} jwk: keystore-location: ${IAM_KEY_STORE_LOCATION:classpath:keystore.jwks}